Fix oc process -o template --template <template>#12230
Fix oc process -o template --template <template>#12230openshift-bot merged 1 commit intoopenshift:masterfrom
Conversation
|
Alternatives:
|
|
let's make it go-template so we're aligned. |
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
7d659e6 to
b97df34
Compare
|
Pushed new version that supports go-template and jsonpath. [test] |
|
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.") |
There was a problem hiding this comment.
i would have expected this to be true?
There was a problem hiding this comment.
I think the value does not really matter, let me check.
There was a problem hiding this comment.
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.
| 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" |
There was a problem hiding this comment.
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.
|
lgtm [merge] |
|
Evaluated for origin merge up to b97df34 |
|
continuous-integration/openshift-jenkins/test SUCCESS (https://ci.openshift.redhat.com/jenkins/job/test_pr_origin/12326/) (Base Commit: 34b4f58) |
|
continuous-integration/openshift-jenkins/merge SUCCESS (https://ci.openshift.redhat.com/jenkins/job/test_pr_origin/12359/) (Base Commit: 6b08947) (Image: devenv-rhel7_5539) |
Before:
After:
@bparees PTAL