-
Notifications
You must be signed in to change notification settings - Fork 4.7k
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
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.
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?
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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
.
There was a problem hiding this comment.
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" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
-o template still works?
There was a problem hiding this comment.
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
.
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