Red Hat Bugzilla – Bug 1303802
Unable to quit from 'oc edit' when the content being edited could not be saved
Last modified: 2016-09-19 09:49:23 EDT
Description of problem:
For `oc edit`, when the content being edited has syntax error, it could not be saved. But it also cannot quit either (e.g. in Vim editor, unable to use `:q!` to quit) unless we kill the process that does the edit.
Version-Release number of selected component (if applicable):
Steps to Reproduce:
1. oc login, create a project
2. Create a rc and edit it, edit restartPolicy value to "Never" (this will make you unable to save and quit), then press `:wq` to save and quit
$ oc run hello-rc --image=openshift/hello-openshift --generator=run-controller/v1
$ oc edit rc hello-rc
3. Being unable to save and quit, press `:q!` to give up the edit and quit
2. `:wq` will fail to save and quit, and prompt "unsupported value 'Never', Details: supported values: Always" (This is expected)
3. `:q!` is unable to give up the edit and quit, unless we kill the process that does the edit, or, edit all unsupported changes back to supported ones and save, quit.(e.g. edit "Never" back to "Always", then save and quit).
3. `:q!` should be able to give up the edit and quit.
In step 3, when pressing `:q!`, it will save a temporary file but seems to enforce syntax check, which causes the problem.
Other resources have similar problem. e.g. edit service .spec.ports.protocol to Ethernet.
Related upstream issue: https://github.com/kubernetes/kubernetes/issues/20078
Fixed in master.
Verified in openshift v1.3.0-alpha.0-603-g8ac876b. Fixed.