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

Fix oc process -o template --template <template> #12230

Merged
merged 1 commit into from
Dec 14, 2016

Conversation

mmilata
Copy link
Contributor

@mmilata mmilata commented Dec 12, 2016

Before:

$ oc process something -o template --template {{.Kind}}
error: template format specified but no template given

After:

$ oc process something -o template --template {{.Kind}}
List

@bparees PTAL

@mmilata
Copy link
Contributor Author

mmilata commented Dec 12, 2016

Alternatives:

  • remove --template
  • use -o go-template={{.something}} like oc get does

@bparees
Copy link
Contributor

bparees commented Dec 12, 2016

let's make it go-template so we're aligned.

@bparees bparees self-assigned this Dec 12, 2016
Before:
  $ oc process something -o template --template {{.Kind}}
  error: template format specified but no template given

After:
  $ oc process something -o template --template {{.Kind}}
  List
  $ oc process something -o go-template --template {{.Kind}}
  List
  $ oc process something -o go-template={{.Kind}}
  List
@mmilata mmilata force-pushed the oc-process-o-template branch from 7d659e6 to b97df34 Compare December 13, 2016 13:57
@mmilata
Copy link
Contributor Author

mmilata commented Dec 13, 2016

Pushed new version that supports go-template and jsonpath. [test]

@openshift-bot
Copy link
Contributor

Evaluated for origin test up to b97df34

// kcmdutil.PrinterForCommand needs these flags, however they are useless
// here because oc process returns list of heterogeneous objects that is
// not suitable for formatting as a table.
cmd.Flags().Bool("no-headers", false, "When using the default output, don't print headers.")
Copy link
Contributor

Choose a reason for hiding this comment

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

i would have expected this to be true?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I think the value does not really matter, let me check.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

It only has effect on the default (table) and custom-columns formats. We're currently not preventing user from passing custom-columns=... (nor do we mention it in help text) but it's unlikely to give any meaningful output anyway.

The value of this flag is ultimately passed as third argument to kubectl.GetPrinter, current master passes false.

Copy link
Contributor

Choose a reason for hiding this comment

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

ok

@@ -22,6 +22,17 @@ os::cmd::expect_success 'oc get templates'
os::cmd::expect_success 'oc get templates ruby-helloworld-sample'
os::cmd::expect_success 'oc get template ruby-helloworld-sample -o json | oc process -f -'
os::cmd::expect_success 'oc process ruby-helloworld-sample'
os::cmd::expect_success_and_text 'oc process ruby-helloworld-sample -o template --template "{{.kind}}"' "List"
Copy link
Contributor

Choose a reason for hiding this comment

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

-o template still works?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yes. Like in oc get it is not shown in help but still works. I suppose it is deprecated in favor of -o go-template.

@bparees
Copy link
Contributor

bparees commented Dec 13, 2016

lgtm [merge]

@openshift-bot
Copy link
Contributor

Evaluated for origin merge up to b97df34

@openshift-bot
Copy link
Contributor

continuous-integration/openshift-jenkins/test SUCCESS (https://ci.openshift.redhat.com/jenkins/job/test_pr_origin/12326/) (Base Commit: 34b4f58)

@openshift-bot
Copy link
Contributor

openshift-bot commented Dec 14, 2016

continuous-integration/openshift-jenkins/merge SUCCESS (https://ci.openshift.redhat.com/jenkins/job/test_pr_origin/12359/) (Base Commit: 6b08947) (Image: devenv-rhel7_5539)

@openshift-bot openshift-bot merged commit 41702ed into openshift:master Dec 14, 2016
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.

3 participants