-
Notifications
You must be signed in to change notification settings - Fork 38.6k
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
kubectl apply --dry-run behaving weirdly #72644
Comments
/sig apply |
/sig cli |
cc @apelisse |
When updating existing objects, kubectl apply doesn't send an entire object, just a patch. It is not exactly correct to print either the existing object or the new object in dry-run mode... the outcome of the merge is what should be printed. For kubectl to be able to accurately reflect the result of the apply, it would need to have the server-side apply logic clientside, which is a non-goal. Current efforts are directed at moving apply logic to the server. As part of that, the ability to dry-run server-side has been added. |
@apelisse we should probably update the flag help for apply and possibly print a warning when using |
Having a random deployment yaml file:
Modifying for example the image or the number of replicas:
kubectl apply -f Deployment.yaml -o yaml --dry-run
outputs me the resource with the OLD specificationskubectl apply -f Deployment.yaml -o yaml
outputs me the resource with the NEW specifications and updates itSince according the documentation:
I would have expected the
dry-run
command to print the very same yaml configuration and not the old one.Tested on minikube, gke v1.10.0
https://stackoverflow.com/questions/54074758/kubectl-apply-dry-run-behaving-weirdly
The text was updated successfully, but these errors were encountered: