-
Notifications
You must be signed in to change notification settings - Fork 23
Open
Labels
bugSomething isn't workingSomething isn't workinggood first issueGood for newcomersGood for newcomerstriageDefault label assigned to all new issues indicating label curation is needed to fully organize.Default label assigned to all new issues indicating label curation is needed to fully organize.
Description
Kyverno JSON Version
0.1.0
Description
I am on version 0.0.2, which I can't select in the bug issue form version selector (I installed via Homebrew, and the only version available there is 0.0.2)
The kyverno-json documentation includes an example ValidatingPolicy that uses validate with a wildcard ?*:
apiVersion: json.kyverno.io/v1alpha1
kind: ValidatingPolicy
metadata:
name: required-s3-tags
spec:
rules:
- name: require-team-tag
identifier: address
match:
any:
- type: aws_s3_bucket
exclude:
any:
- name: bypass-me
validate:
assert:
all:
- values:
tags:
Team: ?*However, this doesn't work. In the Kyverno playground an attempt to use this policy just returns {"results": null}. On the command line there is an error thrown:
$ kyverno-json scan --payload my_payload.yaml --policy required_s3_tags.yaml
Loading policies ...
Error: failed to parse document (spec.rules[0].validate: Invalid value: value provided for unknown field)Steps to reproduce
- Define policy with the YAML example from the documentation:
cat <<EOF > test_policy.yaml
apiVersion: json.kyverno.io/v1alpha1
kind: ValidatingPolicy
metadata:
name: required-s3-tags
spec:
rules:
- name: require-team-tag
identifier: address
match:
any:
- type: aws_s3_bucket
exclude:
any:
- name: bypass-me
validate:
assert:
all:
- values:
tags:
Team: ?*
EOF- Invoke
kyverno-jsonusing that policy:
$ kyverno-json scan --policy test_policy.yamlThis throws an error:
$ kyverno-json scan --policy test_policy.yaml
Loading policies ...
Error: failed to parse document (spec.rules[0].validate: Invalid value: value provided for unknown field)Expected behavior
I had expected that the examples provided in the documentation would work.
Screenshots
No response
Logs
No response
Slack discussion
No response
Troubleshooting
- I have searched other issues in this repository and mine is not recorded.
Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't workinggood first issueGood for newcomersGood for newcomerstriageDefault label assigned to all new issues indicating label curation is needed to fully organize.Default label assigned to all new issues indicating label curation is needed to fully organize.
Type
Projects
Status
No status