Bugzilla will be upgraded to version 5.0. The upgrade date is tentatively scheduled for 2 December 2018, pending final testing and feedback.
Bug 1389681 - `oc edit` for multiple resources does not edit in one single file
`oc edit` for multiple resources does not edit in one single file
Status: CLOSED ERRATA
Product: OpenShift Container Platform
Classification: Red Hat
Component: Command Line Interface (Show other bugs)
3.4.0
Unspecified Unspecified
medium Severity medium
: ---
: ---
Assigned To: Michail Kargakis
Xingxing Xia
: Regression
Depends On: 1309545
Blocks:
  Show dependency treegraph
 
Reported: 2016-10-28 04:46 EDT by XiaochuanWang
Modified: 2017-03-08 13 EST (History)
10 users (show)

See Also:
Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: 1309545
Environment:
Last Closed: 2017-01-18 07:47:20 EST
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)


External Trackers
Tracker ID Priority Status Summary Last Updated
Red Hat Product Errata RHBA-2017:0066 normal SHIPPED_LIVE Red Hat OpenShift Container Platform 3.4 RPM Release Advisory 2017-01-18 12:23:26 EST

  None (edit)
Description XiaochuanWang 2016-10-28 04:46:44 EDT
+++ This bug was initially created as a clone of Bug #1309545 +++

Description:
`oc edit` for multiple resources does not edit in one file. But this worked before.

Version-Release number of selected component (if applicable):
openshift/oc v1.1.3-32-g5ab601a
kubernetes v1.2.0-alpha.7-703-gbc4550d


How reproducible:
Always

Steps to Reproduce:
1. oc login, create a project
2. Create new app
$ oc new-app -f origin/examples/sample-app/application-template-stibuild.jsono
3. Edit multiple resources
1> $ oc edit svc # There are services: frontend and database
2> $ oc edit svc/database dc/database

Actual results:
3.
1> It just edits one resource per file. Press ":wq", it then edits another resource. (This is not convenient. If there are N services and run `oc edit svc`, then need press N times of ":q" to abort edit)
2> Same as 3.1

Expected results:
3. It should edit all resources in one single file as it did in old version of oc.

Additional info:
Seems kubernetes v1.1.0... works well, but kubernetes v1.2.0... works badly.
Here are some other test results:
`oc edit svc/database dc/database` works well when versions are:
oc v1.1-630-gb197d32
kubernetes v1.1.0-origin-1107-g4c8e6f4

Or:
oc v3.1.1.6
kubernetes v1.1.0-origin-1107-g4c8e6f4

Works badly when versions are:
oc v1.1.2-285-gb39b3d8
kubernetes v1.2.0-origin

Or:
oc v3.1.1.902
kubernetes v1.2.0-origin

--- Additional comment from David Eads on 2016-02-18 09:24:27 EST ---

Upstream fix: https://github.com/kubernetes/kubernetes/pull/20918

--- Additional comment from David Eads on 2016-02-19 14:24:11 EST ---

Per Clayton, the fix won't make this release.  Marking for upcoming.

--- Additional comment from Michal Fojtik on 2016-05-31 08:27:01 EDT ---

Waiting for the next rebase to pick this up. Since it will probably slip the 3.2.1, we should set it as upcoming release.

--- Additional comment from Xingxing Xia on 2016-06-16 22:01:45 EDT ---

FYI, there comes a RFE in bug 1347365

--- Additional comment from Javier Ramirez on 2016-06-24 05:45:28 EDT ---



--- Additional comment from Xingxing Xia on 2016-07-25 05:05:48 EDT ---

Checked the PR in comment 1 is merged in latest AMI oc version:
$ oc version
oc v1.3.0-alpha.2+5c862c0
kubernetes v1.3.0+57fb9ac

$ cd github.com/openshift/kubernetes
$ git log --pretty="%h %cd - %s" --date=local 57fb9ac | grep "#20918"
6936b9f Sun May 22 22:12:18 2016 - Merge pull request #20918 from deads2k/fix-list-edit

The issue is fixed. `oc edit` could edit all resources in one single file as it did.
So could move to ON_QA if it is suitable. Thank you.

--- Additional comment from David Eads on 2016-07-25 07:32:34 EDT ---

Upstream rebased into origin.
Comment 1 XiaochuanWang 2016-10-28 04:50:18 EDT
Reproduced again on latest OCP v3.4.0.16
oc v3.4.0.16+cc70b72
`oc edit svc/database dc/database` will edit twice in different files.
Comment 3 Michail Kargakis 2016-11-04 08:21:07 EDT
Both PRs have merged. Moving to MODIFIED until the fix lands in a puddle.
Comment 4 Michail Kargakis 2016-11-04 11:48:45 EDT
Fix in v3.4.0.22
Comment 5 Troy Dawson 2016-11-04 14:43:42 EDT
This has been merged into ose and is in OSE v3.4.0.22 or newer.
Comment 7 XiaochuanWang 2016-11-07 02:38:38 EST
Verified on latest ocp oc v3.4.0.22
One edit, update/skip multiple dc.

# oc edit dc -n xiaocwan-p
deploymentconfig "database" edited
deploymentconfig "dc" skipped
deploymentconfig "frontend" edited
Comment 9 errata-xmlrpc 2017-01-18 07:47:20 EST
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory, and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

https://access.redhat.com/errata/RHBA-2017:0066

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