kubectl: kubectl edit fails with Edit cancelled, no changes made even when file has modifications
What keywords did you search in Kubernetes issues before filing this one? (If you have found any duplicates, you should instead reply there.):
- edit ingress
- edit cancelled
also Google search on error message and kubectls editing
Is this a BUG REPORT or FEATURE REQUEST? (choose one):
BUG REPORT
Kubernetes version (use kubectl version
):
Client Version: version.Info{Major:“1”, Minor:“7”, GitVersion:“v1.7.4”, GitCommit:“793658f2d7ca7f064d2bdf606519f9fe1229c381”, GitTreeState:“clean”, BuildDate:“2017-08-17T08:48:23Z”, GoVersion:“go1.8.3”, Compiler:“gc”, Platform:“linux/amd64”} Server Version: version.Info{Major:“1”, Minor:“7”, GitVersion:“v1.7.3”, GitCommit:“2c2fe6e8278a5db2d15a013987b53968c743f2a1”, GitTreeState:“clean”, BuildDate:“2017-08-03T06:43:48Z”, GoVersion:“go1.8.3”, Compiler:“gc”, Platform:“linux/amd64”}
Environment:
- Cloud provider or hardware configuration: GCE
- OS (e.g. from /etc/os-release):
NAME=“Ubuntu” VERSION=“16.04 LTS (Xenial Xerus)”
- Kernel (e.g.
uname -a
): - Install tools:
- Others:
What happened:
- Open ingress file for editing
kubectl --namespace=<myspace> edit ingress <myingressname>
This opened up vim as expected. I made changes and saved them. - Close vim.
- See message “Edit cancelled, no changes made” Tried this multiple times and made sure I always did a colon-w to write and same result everytime. When I reopen the file, the changes have not been saved.
What you expected to happen: Changes to ingress saved correctly.
How to reproduce it (as minimally and precisely as possible): Seems like an intermittent problem (steps are detailed in the What happened section"), because I have been previous able to edit ingress entries correctly.
Anything else we need to know:
About this issue
- Original URL
- State: closed
- Created 7 years ago
- Comments: 15 (2 by maintainers)
I have similar issue.
Kubectl version:
I’m new to K8s. How to fix this issue ?
Hey Guys! Could you please check if you are using Tabs instead of spaces to indent the block or spaces instead of tabs?
You can also see the error when the file opens again for retry:
I’ve had the same problem and the reason was the key I was try to configure was already somewhere else in the same file but I didn’t notice it.
This is happening probably because you have some mistake in the format of the changes you are making. Hence the changes are being rejected. Please double check that there is no tabs, spacing, extra char, format etc issue in the file changes you just made. Because that was the issue with me, and was getting the same error.
The funny thing is that I’m trying to edit the comments and it just doesn’t see a change so I just get “Edit cancelled, no changes made.”
@i-Apoorva is spot on with this. I changed the image tag and noticed the file was auto-formatting on me.
became
fun little gotcha.