Bug 1303802 - Unable to quit from 'oc edit' when the content being edited could not be saved
Unable to quit from 'oc edit' when the content being edited could not be saved
Status: CLOSED CURRENTRELEASE
Product: OpenShift Origin
Classification: Red Hat
Component: Command Line Interface (Show other bugs)
3.x
Unspecified Unspecified
medium Severity medium
: ---
: ---
Assigned To: Fabiano Franz
Wei Sun
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2016-02-01 21:40 EST by Xingxing Xia
Modified: 2016-09-19 09:49 EDT (History)
2 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2016-09-19 09:49:23 EDT
Type: Bug
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)

  None (edit)
Description Xingxing Xia 2016-02-01 21:40:29 EST
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 13:49:18 EST
Related upstream issue: https://github.com/kubernetes/kubernetes/issues/20078
Comment 2 Fabiano Franz 2016-05-20 17:35:31 EDT
Fixed in master.
Comment 3 Xingxing Xia 2016-05-22 22:14:34 EDT
Verified in openshift v1.3.0-alpha.0-603-g8ac876b. Fixed.

Note You need to log in before you can comment on or make changes to this bug.