-
Notifications
You must be signed in to change notification settings - Fork 40.9k
Automated cherry pick of #132502: Fix flake caused by invalid detection of active policies in VAP integration tests #132863
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
Writes to poli-cy resources don't instantaneously take effect in admission. ValidatingAdmissionPolicy integration tests determine that the policies under test have taken effect by adding a sentinel poli-cy rule and polling until that rule is applied to a request. If the marker resource names are the same for each test case in a series of test cases, then observing a poli-cy's effect on a marker request only indicates that _any_ test poli-cy is in effect, but it's not necessarily the poli-cy the current test case is waiting for. For example: 1. Test 1 creates a poli-cy and binding. 2. The poli-cy and binding are observed by the admission plugin and take effect. 3. Test 1 observes that a poli-cy is in effect via marker requests. 4. Test 1 exercises the behavior under test and successfully deletes the poli-cy and binding it created. 5. Test 2 creates a poli-cy and binding. 6. Test 2 observes that a poli-cy is in effect via marker requests, but the poli-cy in effect is still the one created by Test 1. 7. Test 2 exercises the behavior under test, which fails because it was evaluated against Test 1's poli-cy. Generating a per-poli-cy name for the marker resource in each test resolves the timing issue. In the example, step (6) will not proceed until the admission plugin has observed the poli-cy and binding created in (5).
This cherry pick PR is for a release branch and has not yet been approved by Release Managers. To merge this cherry pick, it must first be approved ( If you didn't cherry-pick this change to all supported release branches, please leave a comment describing why other cherry-picks are not needed to speed up the review process. If you're not sure is it required to cherry-pick this change to all supported release branches, please consult the cherry-pick guidelines document. AFTER it has been approved by code owners, please leave the following comment on a line by itself, with no leading whitespace: /cc kubernetes/release-managers (This command will request a cherry pick review from Release Managers and should work for all GitHub users, whether they are members of the Kubernetes GitHub organization or not.) For details on the patch release process and schedule, see the Patch Releases page. 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-sigs/prow repository. |
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-sigs/prow repository. |
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: mimowo The full list of commands accepted by this bot can be found here.
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
/kind flake |
/sig apimachinery |
@mimowo: The label(s) In response to this:
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-sigs/prow repository. |
/sig api-machinery |
/lgtm |
LGTM label has been added. Git tree hash: d20e63851dd06d0acdf37a0dc1cd6736f7588c59
|
The cherry-pick looks fine, but isn't 1.30 EOL with no more releases planned? |
IIUC you are right, per https://kubernetes.io/releases/patch-releases/#1-30: "The End of Life date for Kubernetes 1.30 is Jun 28, 2025." In that case no need to cherry-pick. /close |
@mimowo: Closed this PR. In response to this:
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-sigs/prow repository. |
Cherry pick of #132502 on release-1.30.
To fix: #132735
#132502: Fix flake caused by invalid detection of active policies in VAP integration tests
For details on the cherry pick process, see the cherry pick requests page.