-
Notifications
You must be signed in to change notification settings - Fork 39.9k
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
Idea: EOL "apply" in favor of more descriptive verbs #118775
Comments
I totally agree with a lot of the sentiment here. I have regularly people asking me why |
I think spec vs status is OK. But it gets way more subtle, like the service-ports merging. It's a correct result for "merge" but very surprising for "apply" and would be obviously wrong for "set". |
Hard for me to understand what you mean by that since I can use "apply" and "merge" almost indistinctly. |
I mean: for many cases, "apply" and "replace" are functionally the same (or close enough). Thus, many people think of "apply" as "fancy replace", when it's really "fancy patch". That leads to surprises and frustration, and bug reports that are actually WAI. |
Also "terraform apply" is closer to "fancy replace" than "fancy patch", so using the same word causes friction. |
/triage accepted |
This issue has not been updated in over 1 year, and should be re-triaged. You can:
For more details on the triage process, see https://www.kubernetes.dev/docs/guide/issue-triage/ /remove-triage accepted |
#118725 illustrates some surprising behavior with
kubectl apply
. I have found, repeatedly, that humans are bad at predicting what apply will do (made worse by client-side and server-side being different).From talking to a lot of people, the
apply
action feels like it meanscreate-or-replace
, but it's really not. It's a much more sophisticated resource co-ownership system. If you don't keep that in mind, it will almost certainly NOT do what you expect it to do, which has led to many bugs over the years (as @apelisse can attest).In hindsight, I wonder if "apply" was the right name for this. Perhaps we really want 2 distinct operations - something like "kubectl set" (simple create-or-replace) and "kubectl merge" (what we call "apply" today). I suspect that vast majority of issues reported with "apply" would be avoided because humans would mostly use "set", and "merge" would be much more clearly a variant of patch, left for "advanced" cases.
Saying
kubectl set -f deploy.yaml
intuitively means one thing, whilekubectl merge -f deploy.yaml
clearly means something else. I don't know if we want to extend that toedit
, too.I wonder if it is possible to steer towards a future where this is clearer. @apelisse @soltysh @KnVerey @eddiezane @jpbetz
The text was updated successfully, but these errors were encountered: