Bug 1316352 - oc edit fails when oc is prefixed with path
oc edit fails when oc is prefixed with path
Status: CLOSED CURRENTRELEASE
Product: OpenShift Origin
Classification: Red Hat
Component: Command Line Interface (Show other bugs)
3.x
Unspecified Unspecified
medium Severity low
: ---
: ---
Assigned To: Michail Kargakis
Wei Sun
:
Depends On:
Blocks: 1336289
  Show dependency treegraph
 
Reported: 2016-03-09 21:45 EST by Xingxing Xia
Modified: 2016-09-19 09:50 EDT (History)
4 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
: 1336289 (view as bug list)
Environment:
Last Closed: 2016-09-19 09:50:49 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-03-09 21:45:07 EST
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
Comment 1 Fabiano Franz 2016-03-10 13:53:09 EST
Michail, can you confirm this is fixed upstream and coming in the rebase in progress?
Comment 2 Michail Kargakis 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.
Comment 3 Michail Kargakis 2016-03-17 06:31:37 EDT
Rebase landed, this should be fixed.
Comment 4 Xingxing Xia 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
Comment 5 Xingxing Xia 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
)
Comment 6 Michail Kargakis 2016-04-30 13:02:53 EDT
https://github.com/openshift/origin/pull/8541 was merged in Origin
Comment 7 Xingxing Xia 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)
Comment 8 Xingxing Xia 2016-05-04 03:42:34 EDT
Verified in oc.exe v1.3.0-alpha.0-282-g8f127d7. Fixed.

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