Repository navigation
fix: tighten Generation exclusivity rule and clarify template namespace docs - #116
Closed
realshuting wants to merge 1 commit into
Closed
realshuting wants to merge 1 commit into
realshuting wants to merge 1 commit into
Conversation
…ce docs - The XValidation rule treated an explicitly empty expression as set, allowing 'expression: ""' alone to pass CRD validation while the compiler rejects it. Require a non-empty expression for expression mode; an empty string now counts as unset, matching compiler semantics. - Clarify the GenerationTemplate.Value description: documents without metadata.namespace are cluster-scoped only for cluster-scoped policies; namespaced policies default them to the policy namespace and reject any other namespace. Follow-up to kyverno#115 review comments on kyverno/kyverno#16699. Signed-off-by: realshuting <shuting@nirmata.com>
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.
Explanation
Follow-up to #115, addressing review comments raised on kyverno/kyverno#16699.
Proposed Changes
Tighten the
generate[]XValidation rule:has(self.expression)treated an explicitly emptyexpression: ""as set, so it passed CRD validation while Kyverno's compiler rejects it. The rule now requires a non-empty expression for expression mode, and treats an empty string as unset — consistent with compiler/runtime semantics.Clarify
GenerationTemplate.Valuedocs: the previous description said documents withoutmetadata.namespaceare treated as cluster-scoped, which is only true for cluster-scoped policies. Namespaced policies default missing namespaces to the policy namespace and reject cross-namespace targets. The field description now states both behaviors.Regenerated CRDs, helm chart CRDs, and API docs.
Once merged, kyverno/kyverno#16699 will bump its dependency to pick up the corrected CRDs.