Bug 1336289 - oc edit fails when oc is prefixed with path
Summary: oc edit fails when oc is prefixed with path
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: OpenShift Container Platform
Classification: Red Hat
Component: oc
Version: 3.2.1
Hardware: Unspecified
OS: Unspecified
medium
low
Target Milestone: ---
: ---
Assignee: Michail Kargakis
QA Contact: Wei Sun
URL:
Whiteboard:
Depends On: 1316352
Blocks:
TreeView+ depends on / blocked
 
Reported: 2016-05-16 06:10 UTC by Xingxing Xia
Modified: 2016-09-07 21:28 UTC (History)
7 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of: 1316352
Environment:
Last Closed: 2016-09-07 21:28:05 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)

Description Xingxing Xia 2016-05-16 06:10:09 UTC
+++ This bug was initially created as a clone of Bug #1316352 +++

Description of problem:
When testing with different version of client, we may specify path/to/oc. But for edit, it fails.

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

How reproducible:
Always

Steps to Reproduce:
/bin/oc get dc
/bin/oc edit dc database
error: open /tmp/bin/oc-edit-sa0n5.yaml: no such file or directory
cd /
bin/oc edit dc database
error: open /tmp/bin/oc-edit-0pcd4.yaml: no such file or directory

Actual results:
Fail as above.

Expected results:
Should edit well when oc is prefixed with path

Additional info:
`./oc edit ...` works
Other similar software like crontab can edit well: /bin/crontab -e   # edit /tmp/crontab.TMJMNj

--- Additional comment from Fabiano Franz on 2016-03-10 13:53:09 EST ---

Michail, can you confirm this is fixed upstream and coming in the rebase in progress?

--- Additional comment from Michail Kargakis on 2016-03-11 04:17:57 EST ---

Yes, this is fixed in https://github.com/kubernetes/kubernetes/pull/22373 and we will have it with the rebase.

--- Additional comment from Michail Kargakis on 2016-03-17 06:31:37 EDT ---

Rebase landed, this should be fixed.

--- Additional comment from Xingxing Xia on 2016-03-17 07:19:40 EDT ---

Verified against:
openshift/oc v1.1.4-87-g16c0e72
kubernetes v1.2.0-beta.1-28-g148dd34

/bin/oc, bin/oc works now

--- Additional comment from Xingxing Xia on 2016-04-18 03:38:50 EDT ---

Windows has similar issue (sorry, did not try Windows last time):
$ dir origin
04/18/2016  07:13 AM        64,314,880 oc.exe

$ origin\oc version
oc v1.1.6-132-g0a5b12b
kubernetes v1.2.0-36-g4a3f9c5

$ origin\oc edit dc database
error: open C:\Users\OPPENS~1\AppData\Local\Temp\origin\oc.exe-edit-evm56.yaml: The system cannot find the path specified.

(Similarly, .\oc edit works:
cd origin
.\oc edit dc database
)

--- Additional comment from Michail Kargakis on 2016-04-30 13:02:53 EDT ---

https://github.com/openshift/origin/pull/8541 was merged in Origin

--- Additional comment from Xingxing Xia on 2016-05-03 01:43:52 EDT ---

@Michail
Met error when run `hack/build-release.sh` to get windows oc.exe:
[root@ip-172-18-10-4 origin]# hack/build-release.sh
++ Building release v1.3.0-alpha.0-267-gcd62e58
++ Building go targets for linux/amd64: cmd/openshift cmd/oc
++ Building go targets for darwin/amd64: cmd/openshift cmd/oc
++ Building go targets for windows/amd64: cmd/openshift cmd/oc
Godeps/_workspace/src/github.com/docker/go-connections/sockets/sockets_windows.go:7:2: cannot find package "github.com/Microsoft/go-winio" in any of:
	/usr/local/go/src/github.com/Microsoft/go-winio (from $GOROOT)
	/go/src/github.com/openshift/origin/Godeps/_workspace/src/github.com/Microsoft/go-winio (from $GOPATH)
	/go/src/github.com/Microsoft/go-winio
!!! Error in hack/../hack/common.sh:301
	'GOOS=${platform%/*} GOARCH=${platform##*/} go install "${goflags[@]:+${goflags[@]}}" -ldflags "${version_ldflags}" "${nonstatics[@]}"' exited with status 1
Call stack:
	1: hack/../hack/common.sh:301 os::build::build_binaries(...)
	2: hack/build-cross.sh:28 main(...)
Exiting with status 1
!!! Error in hack/../hack/common.sh:253
	'os::build::build_binaries "${OS_CROSS_COMPILE_TARGETS[@]}"' exited with status 1
Call stack:
	1: hack/../hack/common.sh:253 os::build::build_binaries(...)
	2: hack/build-cross.sh:28 main(...)
Exiting with status 1
!!! Error in hack/build-release.sh:45
	'docker run -e "OS_ONLY_BUILD_PLATFORMS=${OS_ONLY_BUILD_PLATFORMS-}" -i --cidfile="${context}/cid" openshift/origin-release' exited with status 0 1
Call stack:
	1: hack/build-release.sh:45 main(...)
Exiting with status 1

(Not meet this error in the past. How to resolve it? I tried git clone the GH microsoft/go-winio under /usr/local/go/src/github.com/Microsoft/, the error still happens)

--- Additional comment from Xingxing Xia on 2016-05-04 03:42:34 EDT ---

Verified in oc.exe v1.3.0-alpha.0-282-g8f127d7. Fixed.

Comment 1 Xingxing Xia 2016-05-16 06:13:21 UTC
Seems the PR fixing Windows https://github.com/openshift/origin/pull/8541 is not merged into OSE yet.
Reproduced in Windows when testing with latest puddle: oc v3.2.0.44 kubernetes v1.2.0-36-g4a3f9c5
Please help merge.

Comment 2 Michail Kargakis 2016-05-31 09:13:07 UTC
OSE pr: https://github.com/openshift/ose/pull/256

Comment 3 Xingxing Xia 2016-06-02 02:10:52 UTC
Checked the PR is merged in master, but not in 3.2 branch. Wait for the puddle.

Comment 4 Xingxing Xia 2016-06-06 09:41:27 UTC
Checked with Win oc v3.2.1.1-1-g33fa4ea, oc edit now works when oc is prefixed with path. Fixed.


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