Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add --local & --dry-run flags to oc set sub-commands #14123

Conversation

juanvallejo
Copy link
Contributor

UPSTREAM: kubernetes/kubernetes#36071
Related Bugzilla: https://bugzilla.redhat.com/show_bug.cgi?id=1390139

Related PR (adds --local and --dr-run flags to oc set resources): #11694

Partially addresses: #7899

some oc set ... sub-commands do not implement --dry-run or --local
options. This patch adds these missing options to all sub-commands and
ensures that backwards compatibility remains for commands that treat the
--output option as a ``dry-run flag.

Example
$ oc set image dc dctest dctest-1=default/testimage:latest --dry-run
NAME      REVISION   DESIRED   CURRENT   TRIGGERED BY
dctest    1          1         1         config

$ oc set image dc dctest dctest-1=default/testimage:latest -o name
deploymentconfig/dctest

$ oc set build-secret mysecret --push --all -o
custom-columns=NAME:.metadata.name
NAME
gitauthtest
repo-base

$ oc set build-secret mysecret --push --all --dry-run
NAME          TYPE      FROM      LATEST
gitauthtest   Source    Git       1
NAME        TYPE      FROM      LATEST
repo-base   Docker    Git       8
Affected commands

Restoring #11733

some `oc set ...` sub-commands do not implement `--dry-run` or `--local`
options. This patch adds these missing options to all sub-commands and
ensures that backwards compatibility remains for commands that treat the
--output option as a ``dry-run flag.

```
$ oc set image dc dctest dctest-1=default/testimage:latest --dry-run
NAME      REVISION   DESIRED   CURRENT   TRIGGERED BY
dctest    1          1         1         config

$ oc set image dc dctest dctest-1=default/testimage:latest -o name
deploymentconfig/dctest

$ oc set build-secret mysecret --push --all -o
custom-columns=NAME:.metadata.name
NAME
gitauthtest
repo-base

$ oc set build-secret mysecret --push --all --dry-run
NAME          TYPE      FROM      LATEST
gitauthtest   Source    Git       1
NAME        TYPE      FROM      LATEST
repo-base   Docker    Git       8
```
@juanvallejo
Copy link
Contributor Author

[test]

@juanvallejo
Copy link
Contributor Author

flake #14122 re[test]

@openshift-bot
Copy link
Contributor

Evaluated for origin test up to 763e6ec

@openshift-bot
Copy link
Contributor

continuous-integration/openshift-jenkins/test SUCCESS (https://ci.openshift.redhat.com/jenkins/job/test_pull_request_origin/1318/) (Base Commit: f714687)

1 similar comment
@openshift-bot
Copy link
Contributor

continuous-integration/openshift-jenkins/test SUCCESS (https://ci.openshift.redhat.com/jenkins/job/test_pull_request_origin/1318/) (Base Commit: f714687)

@fabianofranz fabianofranz changed the title UPSTREAM: 36071: Add --local & --dry-run flags to oc set sub-commands Add --local & --dry-run flags to oc set sub-commands May 12, 2017
@fabianofranz
Copy link
Member

[merge] tks @juanvallejo!

@openshift-bot
Copy link
Contributor

Evaluated for origin merge up to 763e6ec

@openshift-bot
Copy link
Contributor

openshift-bot commented May 12, 2017

continuous-integration/openshift-jenkins/merge SUCCESS (https://ci.openshift.redhat.com/jenkins/job/merge_pull_request_origin/619/) (Base Commit: f24a57f) (Image: devenv-rhel7_6225)

@openshift-bot openshift-bot merged commit 9bcaa0a into openshift:master May 12, 2017
@juanvallejo juanvallejo deleted the jvallejo/fix-oc-set-image-local-output branch May 12, 2017 18:33
@smarterclayton
Copy link
Contributor

This requires --local, but --local doesn't behave correctly after this PR for oc set probe or several others - just fails if the server is down.

@smarterclayton
Copy link
Contributor

Local means "doesn't require a running server"

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants