return error in oc set env RESOURCE when no env args are provided#10485
Conversation
pkg/cmd/cli/cmd/set/env.go
Outdated
| if err != nil { | ||
| return err | ||
| } | ||
| if len(env) == 0 { |
There was a problem hiding this comment.
Doesn't this break --list?
There was a problem hiding this comment.
Hm, it does, I could add a check to make sure --list is not set before returning this error
Related BZ: https://bugzilla.redhat.com/show_bug.cgi?id=1366559 The command `oc set RESOURCE` prompts a user that the resource has been updated even when no other args are provided: ``` $ oc set env dc/database deploymentconfig "database" updated ``` This patch makes sure that at least one pair of environment variable arguments are passed: ``` $ oc set env dc/database error: at least one environment variable must be provided ```
95d690f to
51e2be6
Compare
|
@liggitt ptal |
|
[test] |
|
@openshift-bot, the last build failed from the following flakes:
re[test] |
1 similar comment
|
@openshift-bot, the last build failed from the following flakes:
re[test] |
|
Evaluated for origin test up to 51e2be6 |
|
continuous-integration/openshift-jenkins/test SUCCESS (https://ci.openshift.redhat.com/jenkins/job/test_pr_origin/8143/) |
|
LGTM [merge] |
|
continuous-integration/openshift-jenkins/merge SUCCESS (https://ci.openshift.redhat.com/jenkins/job/test_pr_origin/8143/) (Image: devenv-rhel7_4868) |
|
Evaluated for origin merge up to 51e2be6 |
Related BZ: https://bugzilla.redhat.com/show_bug.cgi?id=1366559
The command
oc set RESOURCEprompts a user that the resource has beenupdated even when no other args are provided:
This patch makes sure that at least one pair of environment variable
arguments are passed before returning a successful message:
cc @fabianofranz