-
Notifications
You must be signed in to change notification settings - Fork 40.1k
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
DRA API: validate node selector labels #128932
DRA API: validate node selector labels #128932
Conversation
Previously, ValidateNodeSelector did not check that labels are valid. Now it does for resource.k8s.io, regardless whether an object already was created with invalid labels in an earlier Kubernetes release. Theoretically this is a breaking change and could cause problems during an upgrade, but that is highly unlikely in practice. In contrast to node affinity, DRA does not ignore parse errors (= uses NewNodeSelector, not NewLazyErrorNodeSelector), so invalid labels would have been found instead of being silently ignored. Even if some object has invalid labels, this only affects an alpha -> beta upgrade which isn't guaranteed to work seamlessly.
/priority critical-urgent |
change lgtm I'm strongly in favor of tightening the validation prior to the beta API release. @thockin, would you agree? If so, this will need milestoning by the release team, ideally ahead of the rc.0 |
LGTM label has been added. Git tree hash: 922547ff7b7cc56898038b29ac3120e9d39941dc
|
/hold For comment by @thockin, in case that we get the milestone first. |
/milestone v1.32 |
ACK to fix this before 32. /approve |
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: fsmunoz, liggitt, pohly, thockin 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 bug
What this PR does / why we need it:
Previously, ValidateNodeSelector did not check that labels are valid. Now it does for resource.k8s.io, regardless whether an object already was created with invalid labels in an earlier Kubernetes release. Theoretically this is a breaking change and could cause problems during an upgrade, but that is highly unlikely in practice.
In contrast to node affinity, DRA does not ignore parse errors (= uses NewNodeSelector, not NewLazyErrorNodeSelector), so invalid labels would have been found instead of being silently ignored.
Even if some object has invalid labels, this only affects an alpha -> beta upgrade which isn't guaranteed to work seamlessly.
Which issue(s) this PR fixes:
Related-to: #128156
Special notes for your reviewer:
This PR is a subset of #128212. It was stripped down to just the parts which strengthen validation of resource.k8s.io.
We need to get this included in 1.32 because the resource.k8s.io API gets promoted to beta in 1.32. Making this change later would be more complicated.
Does this PR introduce a user-facing change?
Additional documentation e.g., KEPs (Kubernetes Enhancement Proposals), usage docs, etc.:
/cc @AxeZhan @thockin @liggitt @kubernetes/release-team-leads