-
Notifications
You must be signed in to change notification settings - Fork 1.1k
feat: Extend CLI to cover generate policies #3456
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
Signed-off-by: Shubham Nazare <shubham4443@gmail.com>
Signed-off-by: Shubham Nazare <shubham4443@gmail.com>
Codecov Report
@@ Coverage Diff @@
## main #3456 +/- ##
==========================================
- Coverage 29.63% 29.49% -0.14%
==========================================
Files 138 138
Lines 18377 18462 +85
==========================================
Hits 5446 5446
- Misses 12268 12353 +85
Partials 663 663
Continue to review full report at Codecov.
|
Signed-off-by: Shubham Nazare <shubham4443@gmail.com>
…into cli-generate
Signed-off-by: Shubham Nazare <shubham4443@gmail.com>
Signed-off-by: Shubham Nazare <shubham4443@gmail.com>
Signed-off-by: Shubham Nazare <shubham4443@gmail.com>
Signed-off-by: Shubham Nazare <shubham4443@gmail.com>
Signed-off-by: Shubham Nazare <shubham4443@gmail.com>
Signed-off-by: Shubham Nazare <shubham4443@gmail.com>
Signed-off-by: Shubham Nazare <shubham4443@gmail.com>
Signed-off-by: Shubham Nazare <shubham4443@gmail.com>
Signed-off-by: Shubham Nazare <shubham4443@gmail.com>
Signed-off-by: Shubham Nazare <shubham4443@gmail.com>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
changes looks good . some minor comment
return nil, err | ||
} | ||
return resource, nil | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
can we move this helper/utils methods to pkg/background/common/util.go
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
While moving c.client.GetResource
throws an error because client field of GenerateController instance is not exported.
Signed-off-by: Shubham Nazare <shubham4443@gmail.com>
/lgtm |
@shubham4443 now that this is available in the 1.8.0 CLI and I test using the samples, I notice if I comment out the |
@chipzoller I'm seeing the same issue. Not sure why it is happening. |
Related issue
Fixes #3114
Maintainers @prateekpandey14 @vyankyGH
Milestone of this PR
What type of PR is this
/kind feature
Proposed Changes
Prior to this PR, only validate and mutate policies were covered by the CLI
test
command. This PR adds the ability to test generate policies. A complete design proposal can be found here.Proof Manifests
Consider this generate policy. A sample kyverno-test.yaml file for this policy would look like this -
resource.yaml is the manifest for creating Namespace resource.
Our test will pass if our generatedResource.yaml looks like this -
Checklist
Further Comments