Bug 1303802 - Unable to quit from 'oc edit' when the content being edited could not be saved
Summary: Unable to quit from 'oc edit' when the content being edited could not be saved
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: OKD
Classification: Red Hat
Component: oc
Version: 3.x
Hardware: Unspecified
OS: Unspecified
medium
medium
Target Milestone: ---
: ---
Assignee: Fabiano Franz
QA Contact: Wei Sun
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2016-02-02 02:40 UTC by Xingxing Xia
Modified: 2016-09-19 13:49 UTC (History)
2 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2016-09-19 13:49:23 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)

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.


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