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

update oc env, return resources in list #11379

Conversation

juanvallejo
Copy link
Contributor

Fixes #11377

Running a command such as
oc new-app https://myrepo -o yaml | oc set env -f - MYVAR=value -o yaml will not return a set of resources in an api.List, but rather
print them out individually. This prevents all items from being piped to
another oc command successfully, as only the last item will be parsed.

This patch appends all resources to an api.List before printing.

cc @openshift/cli-review @csrwng


resourceList := &kapi.List{}
resourceList.APIVersion = outputVersion.Version
resourceList.Kind = "List"
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@fabianofranz I am not sure if this is the correct way of achieving this. If this field is not set, I receive a list with no Kind field, preventing it from being parsed by commands like oc create

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@juanvallejo juanvallejo force-pushed the jvallejo/return-oc-env-items-in-list branch from 4bb35fb to db7fe11 Compare October 17, 2016 15:37
@fabianofranz
Copy link
Member

LGTM, squash?

Running a command such as
`oc new-app https://myrepo -o yaml | oc set env -f - MYVAR=value -o
yaml` will not return a set of resources in an `api.List`, but rather
print them out individually. This prevents all items from being piped to
another `oc` command successfully, as only the last item will be parsed.

This patch appends all resources to an api.List before printing.
@juanvallejo juanvallejo force-pushed the jvallejo/return-oc-env-items-in-list branch from db7fe11 to 57afc8a Compare October 18, 2016 15:27
@juanvallejo
Copy link
Contributor Author

@fabianofranz

LGTM, squash?

Done!

@fabianofranz
Copy link
Member

[merge]

@openshift-bot
Copy link
Contributor

[Test]ing while waiting on the merge queue

@openshift-bot
Copy link
Contributor

Evaluated for origin test up to 57afc8a

@openshift-bot
Copy link
Contributor

continuous-integration/openshift-jenkins/test FAILURE (https://ci.openshift.redhat.com/jenkins/job/test_pr_origin/10186/) (Base Commit: f6bd74b)

@juanvallejo
Copy link
Contributor Author

@fabianofranz check test flaked on #11443

@fabianofranz
Copy link
Member

fabianofranz commented Oct 20, 2016

flaked on #11442 re[merge]

@juanvallejo
Copy link
Contributor Author

@fabianofranz I accidentally linked the PR to solve the flake, rather than the actual issue :/ sorry about that #11442

@marun
Copy link
Contributor

marun commented Oct 21, 2016

flake #11452 re-[merge]

@juanvallejo
Copy link
Contributor Author

check flaked on #11024

@fabianofranz
Copy link
Member

flaked on #11024 re[merge]

@openshift-bot
Copy link
Contributor

Evaluated for origin merge up to 57afc8a

@openshift-bot
Copy link
Contributor

openshift-bot commented Oct 21, 2016

continuous-integration/openshift-jenkins/merge SUCCESS (https://ci.openshift.redhat.com/jenkins/job/test_pr_origin/10435/) (Base Commit: 2dccff1) (Image: devenv-rhel7_5216)

@openshift-bot openshift-bot merged commit 2016d68 into openshift:master Oct 21, 2016
@juanvallejo juanvallejo deleted the jvallejo/return-oc-env-items-in-list branch October 21, 2016 20:44
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.

5 participants