[NRR] add CEL validation for taint key format against Kubernetes qualified name rule#155
Conversation
…ules exactly one '/' separator (prefix/name format), 1-63 character, alphanumeric, '-', '_', '.', must start/end with alphanumeric ref: git.k8s.io/kubernetes/staging/src/k8s.io/apimachinery/pkg/api/validate/content/kube.go#L24-L72
|
@Priyankasaggu11929: The label(s) DetailsIn 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. |
✅ Deploy Preview for node-readiness-controller canceled.
|
|
/lgtm Thanks for catching this! |
|
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: ajaysundark, Priyankasaggu11929 The full list of commands accepted by this bot can be found here. The pull request process is described here DetailsNeeds approval from an approver in each of these files:
Approvers can indicate their approval by writing |
/kind feature
/kind design
This PR is adding CEL validation (x-kubernetes-validation) to the NRR (node readiness rule) CRD to make sure that the taint keys in NodeReadinessRule object follow the Kubernetes qualified name format defined here -
https://github.com/kubernetes/kubernetes/blob/dfbe79674a33c47c1f0fd7b75882314f6db5e136/staging/src/k8s.io/apimachinery/pkg/api/validate/content/kube.go#L24-L72
Related Issue
It was flagged while locally testing the security-agent-readiness.md guide.
The suggested node taint in the doc (
readiness.k8s.io/falco.org/security-agent-ready=pending:NoSchedule) is not a valid taint format and thus fails at admission time with the following error:But the same taint (
readiness.k8s.io/falco.org/security-agent-ready=pending:NoSchedule) defined in the NRR object goes through admission without error, which should not be the case.The taints defined in the NRR object should match the taint format/validation per the Kubernetes qualified name format.
Testing
Relevant truncated output of the newly added e2e tests:
Checklist
make testpassesmake lintpassesmake test-e2epassesmake verify-allpassesDoes this PR introduce a user-facing change?