fix: correct broken CLI test data for allowed-label-changes and prepend-image-registry#1439
Open
AIWithShrey wants to merge 1 commit intokyverno:mainfrom
Open
fix: correct broken CLI test data for allowed-label-changes and prepend-image-registry#1439AIWithShrey wants to merge 1 commit intokyverno:mainfrom
AIWithShrey wants to merge 1 commit intokyverno:mainfrom
Conversation
Two test suites had incorrect test expectations that were silently passing due to a bug in the CLI test result reporting (kyverno/kyverno#15355). The fix in kyverno/kyverno#15361 correctly reports these as failures. allowed-label-changes: - Policy uses request.oldObject in a deny rule, which is unavailable in CLI mode. The deny condition cannot evaluate, so badpod01 passes rather than fails. Changed expected result to pass. prepend-image-registry: - Mutation successfully applies registry.io/ prefix to all container images, but test expected result: fail with un-mutated patched resources. Updated expected results to pass and patched resource files to include the registry.io/ prefix. Signed-off-by: Shreyas Mocherla <shreyas@shreyasm.com>
9 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Fixes 4 broken CLI test cases exposed by the test reporting fix in kyverno/kyverno#15361:
request.oldObjectin a deny rule which is unavailable in CLI mode. The deny condition cannot evaluate, sobadpod01passes. Changed expected result fromfailtopass.registry.io/prefix to all images, but 3 test cases expectedresult: failwith un-mutated patched resources. Updated expected results topassand corrected patched resource files to include theregistry.io/prefix.These tests were silently passing due to a bug in CLI test result reporting where any legacy policy test expecting
result: failalways showed as passing regardless of the actual engine result.Verification
All 4891 tests pass with the fix applied (was 4887 pass + 4 fail):
Depends on: kyverno/kyverno#15361