Bug 1304251
Summary: | "--overwrite=false" does not work for `oc env` | ||
---|---|---|---|
Product: | OKD | Reporter: | Xingxing Xia <xxia> |
Component: | oc | Assignee: | Fabiano Franz <ffranz> |
Status: | CLOSED CURRENTRELEASE | QA Contact: | Xingxing Xia <xxia> |
Severity: | medium | Docs Contact: | |
Priority: | medium | ||
Version: | 3.x | CC: | aos-bugs, ffranz, mmccomas, wewang |
Target Milestone: | --- | ||
Target Release: | --- | ||
Hardware: | Unspecified | ||
OS: | Unspecified | ||
Whiteboard: | |||
Fixed In Version: | Doc Type: | Bug Fix | |
Doc Text: | Story Points: | --- | |
Clone Of: | Environment: | ||
Last Closed: | 2016-09-19 13:50:31 UTC | Type: | Bug |
Regression: | --- | Mount Type: | --- |
Documentation: | --- | CRM: | |
Verified Versions: | Category: | --- | |
oVirt Team: | --- | RHEL 7.3 requirements from Atomic Host: | |
Cloudforms Team: | --- | Target Upstream Version: | |
Embargoed: |
Description
Xingxing Xia
2016-02-03 06:58:42 UTC
Tested with: oc v1.3.0-alpha.2-194-g82718a8 kubernetes v1.3.0-alpha.3-599-g2746284 The problem is fixed. --overwrite=false takes effect now. The results of step 4.1 and 5.1 give message: error: replicationcontrollers/hello-rc 'MY_ENV' already has a value (VALUE), and --overwrite is false error: no environment variable has been set But when used for multiple resources, in which some resource already has defined the var but some other resource does not yet defined that var, it will do additional PATCH on the former resource: # Prepare steps oc run hello-rc --image=openshift/hello-openshift --generator=run-controller/v1 oc run world-rc --image=openshift/hello-openshift --generator=run-controller/v1 oc set env rc/hello-rc -e MY_ENV=VALUE oc set env rc hello-rc world-rc --list # replicationcontrollers hello-rc, container hello-rc MY_ENV=VALUE # replicationcontrollers world-rc, container world-rc # Now check the issue oc set env rc hello-rc world-rc -e MY_ENV=newvalue --overwrite=false error: replicationcontrollers/hello-rc 'MY_ENV' already has a value (VALUE), and --overwrite is false replicationcontroller "hello-rc" updated <-- ** Note this message (the additional PATCH does not take effect, though) replicationcontroller "world-rc" updated # see with --loglevel oc set env rc hello-rc world-rc -e MY_ENV=newvalue --overwrite=false --loglevel 6 ... GET https://<master>:8443/api/v1/namespaces/xxia-proj/replicationcontrollers/world-rc 200 OK in 258 milliseconds error: replicationcontrollers/hello-rc 'MY_ENV' already has a value (VALUE), and --overwrite is false ... PATCH https://<master>:8443/api/v1/namespaces/xxia-proj/replicationcontrollers/hello-rc 200 OK in 256 milliseconds replicationcontroller "hello-rc" updated ... # for single resource, does not do the additional PATCH oc set env rc hello-rc -e MY_ENV=newvalue --overwrite=false --loglevel 6 ... GET https://<master>:8443/api/v1/namespaces/xxia-proj/replicationcontrollers/hello-rc 200 OK in 255 milliseconds error: replicationcontrollers/hello-rc 'MY_ENV' already has a value (VALUE), and --overwrite is false F0624 17:33:21.523285 18414 helpers.go:107] error: no environment variable has been set ^ ** No additional PATCH after error message So need fix the issue? If necessary, could use a new bug to track it. Fixed in https://github.com/openshift/origin/pull/9552, we also removed the "no environment variable has been set" message. |