Bug 1303802

Summary: Unable to quit from 'oc edit' when the content being edited could not be saved
Product: OKD Reporter: Xingxing Xia <xxia>
Component: ocAssignee: Fabiano Franz <ffranz>
Status: CLOSED CURRENTRELEASE QA Contact: Wei Sun <wsun>
Severity: medium Docs Contact:
Priority: medium    
Version: 3.xCC: aos-bugs, mmccomas
Target Milestone: ---   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2016-09-19 13:49:23 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:

Description Xingxing Xia 2016-02-02 02:40:29 UTC
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):
openshift/oc v1.1.1-318-gc7aec97
kubernetes v1.2.0-alpha.4-851-g4a65fa1

How reproducible:
Always

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

Actual results:
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).

Expected results:
3. `:q!` should be able to give up the edit and quit.

Additional info:
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.

Comment 1 Fabiano Franz 2016-02-02 18:49:18 UTC
Related upstream issue: https://github.com/kubernetes/kubernetes/issues/20078

Comment 2 Fabiano Franz 2016-05-20 21:35:31 UTC
Fixed in master.

Comment 3 Xingxing Xia 2016-05-23 02:14:34 UTC
Verified in openshift v1.3.0-alpha.0-603-g8ac876b. Fixed.