-
Notifications
You must be signed in to change notification settings - Fork 920
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 diff fails to detect differences in Service objects #1601
Comments
Have you verified that the |
@jrcast have you checked if kubectl command executed successfully without error ? |
/remove-kind bug |
/kind support |
Can confirm this happens when you make changes using If you use the
But if you use that flag, it's going to add the /remove-kind support |
/triage accepted |
Hello @ardaguclu - Can i pick this up? |
Hi @vikasrajputin, are you still working on this issue? If not I would love to work on this. cc @ardaguclu |
Since no answers and upon discussion with @ardaguclu taking this on me /assign |
This not only happens with an 1- Have two different service YAMLs. One is for the initial state (service.yaml), the other one (service-with-additional-port.yaml) is for the updated state (with the additional port etc.) Adding an integration test for this scenario first & investigating in parallel. JFYI |
Let me explain how the diff works roughly and the problem behind the above issue is. When you do For the As you can see in the The modified object, which is the resource in the YAML file, is returned as a byte array here and used in the patching action here The main problem is, when you do a patch in both ways, because the YAML file has less resources than our So if we want to get a diff between a resource YAML that has less items (e.i removed items from an array or just a field etc.), we should either get rid of the @ardaguclu any ideas here? or if you can tag someone else (like the original author) who might some insights, that will be appreciated. If I am not clear enough I can rephrase, re-explain happily either here or in one of the comm. meetings if needed. Update: [**] When we use the local resource directly instead of the merged one we can get a diff as follows:
In this case we get K8s generated resources as well not only the port diff. So main idea behind the merge maybe simply avoiding this. |
What happened:
kubectl diff
is not detecting diffs between a service's manifest file and the modified service object in Kubernetes. I tried both client-side or server-side mode without success.What you expected to happen:
kubectl diff
identifies the diffHow to reproduce:
kubectl create -f my-svc.yaml
. Wheremy-svc.yaml
is:kubectl edit
, modify the K8s service. i.e. Add an extra port.kubectl diff -f my-svc.yaml # or kubectl diff -f my-svc.yaml --server-side --force-conflicts
Anything else we need to know?:
Environment:
kubectl version
): 1.27 on both server/client. Also tried 1.30 with same results.cat /etc/os-release
): Ubuntu 22.04.4 LTSThe text was updated successfully, but these errors were encountered: