-
Notifications
You must be signed in to change notification settings - Fork 43.2k
Server Side Apply - Selectors are not atomic #97970
Copy link
Copy link
Labels
kind/bugCategorizes issue or PR as related to a bug.Categorizes issue or PR as related to a bug.needs-triageIndicates an issue or PR lacks a `triage/foo` label and requires one.Indicates an issue or PR lacks a `triage/foo` label and requires one.wg/api-expressionCategorizes an issue or PR as relevant to WG API Expression.Categorizes an issue or PR as relevant to WG API Expression.
Milestone
Metadata
Metadata
Assignees
Labels
kind/bugCategorizes issue or PR as related to a bug.Categorizes issue or PR as related to a bug.needs-triageIndicates an issue or PR lacks a `triage/foo` label and requires one.Indicates an issue or PR lacks a `triage/foo` label and requires one.wg/api-expressionCategorizes an issue or PR as relevant to WG API Expression.Categorizes an issue or PR as relevant to WG API Expression.
Type
Fields
Give feedbackNo fields configured for issues without a type.
While closing the #92913 fixed a problem for structured selectors across
k/kapi, there is still a great deal of unstructured selectors across different resources as amap[string]string. So a similar problem is present - SSA does not work for modifying these when a multiple source-of-truths attempting to manage this field in parallel.Say a user and a controller is doing changes to the resource.selector field. If a user changes (appends) a
key: valueto the map, he completely alters the behavior for the resource. The controller can't do anything with it, as SSO treats the map asgranularresource by default. So you have to fall back to a usualget/compare/updatefor changes like that, or you can't guarantee the declarative behavior for your controller, which is supposed to set and maintain the fields it cares about as it expects it to be looking.What happened:
Here is a resource:
kubectl apply --server-side -f svc.yaml, the resource is applied.spec.selectormap and fails to do the job with existing infrastructure, as the selector does not match any of the resource labels.What you expected to happen:
Step 2 applies a selector as an atomic value, so the resource in step 3 looks more like
How to reproduce it (as minimally and precisely as possible):
See what happend section
A followup to #92913
Anything else we need to know?:
Environment:
kubectl version): 1.20