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
Add CRD integration tests for ValidatingAdmissionPolicy #113795
Add CRD integration tests for ValidatingAdmissionPolicy #113795
Conversation
Skipping CI for Draft Pull Request. |
@DangerOnTheRanger: This issue is currently awaiting triage. If a SIG or subproject determines this is a relevant issue, they will accept it by applying the The Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. |
19c0814
to
a317a3a
Compare
test/integration/apiserver/cel/validatingadmissionpolicy_test.go
Outdated
Show resolved
Hide resolved
test/integration/apiserver/cel/validatingadmissionpolicy_test.go
Outdated
Show resolved
Hide resolved
b80dcaa
to
646b71e
Compare
}, | ||
policy: withValidations([]admissionregistrationv1alpha1.Validation{ | ||
{ | ||
Expression: "params.spec.someNum == 2", |
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.
Should the expression use the param object to compare it against the object being validated in some way?
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.
Maybe compare someNum
against a Deployment's replicaset or similar?
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.
I changed it to use strings/a similar name check as with some of the other tests - it's a bit similar to the ConfigMap
tests now, but I think the CRD codepaths are still being hit, so it should be fine.
test/integration/apiserver/cel/validatingadmissionpolicy_test.go
Outdated
Show resolved
Hide resolved
test/integration/apiserver/cel/validatingadmissionpolicy_test.go
Outdated
Show resolved
Hide resolved
dcfd1f2
to
8fcd58f
Compare
test/integration/apiserver/cel/validatingadmissionpolicy_test.go
Outdated
Show resolved
Hide resolved
test/integration/apiserver/cel/validatingadmissionpolicy_test.go
Outdated
Show resolved
Hide resolved
test/integration/apiserver/cel/validatingadmissionpolicy_test.go
Outdated
Show resolved
Hide resolved
test/integration/apiserver/cel/validatingadmissionpolicy_test.go
Outdated
Show resolved
Hide resolved
test/integration/apiserver/cel/validatingadmissionpolicy_test.go
Outdated
Show resolved
Hide resolved
test/integration/apiserver/cel/validatingadmissionpolicy_test.go
Outdated
Show resolved
Hide resolved
test/integration/apiserver/cel/validatingadmissionpolicy_test.go
Outdated
Show resolved
Hide resolved
test/integration/apiserver/cel/validatingadmissionpolicy_test.go
Outdated
Show resolved
Hide resolved
test/integration/apiserver/cel/validatingadmissionpolicy_test.go
Outdated
Show resolved
Hide resolved
test/integration/apiserver/cel/validatingadmissionpolicy_test.go
Outdated
Show resolved
Hide resolved
Ran
|
/retest |
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.
LGTM, commits need to be cleaned up though (a commit per new test seems fine)
Not sure if release team is accepting new test PRs at this point (we're past test freeze I think). Putting the v1.26 milestone to put this on the release team's radar and will defer to them.
/milestone v1.26
12eb052
to
19242ec
Compare
(force push to squash commits) |
/release-note none |
/release-note-none |
/milestone clear (based on discussion with release team to defer this to v1.27) |
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.
/approve
/lgtm
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: andrewsykim, DangerOnTheRanger The full list of commands accepted by this bot can be found here. The pull request process is described here
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
What type of PR is this?
/kind feature
What this PR does / why we need it:
This PR adds integration tests that check CRD parameter resources can be used with ValidatingAdmissionPolicy. This PR also adds an additional test (
TestBindingRemoval
) that was originally intended to merge as a part of #113314.Which issue(s) this PR fixes:
Special notes for your reviewer:
Does this PR introduce a user-facing change?
Additional documentation e.g., KEPs (Kubernetes Enhancement Proposals), usage docs, etc.: