You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit 2eef243
Browse filesBrowse the repository at this point in the historyBrowse files
Kubernetes Submit Queue
authored
Merge pull request #39954 from ncdc/automated-cherry-pick-of-#39486-#39895-#39038-upstream-release-1.5
Automatic merge from submit-queue
Automated cherry pick of #39486#39895#39038
Cherry pick of #39486#39895#39038 on release-1.5.
#39486: Allow missing keys in templates by default
#39895: Fix expected error text
#39038: Fix kubectl get -f <file> -o <nondefault printer>
// AddOutputFlags adds output related flags to a command.
49
49
funcAddOutputFlags(cmd*cobra.Command) {
50
50
cmd.Flags().StringP("output", "o", "", "Output format. One of: json|yaml|wide|name|custom-columns=...|custom-columns-file=...|go-template=...|go-template-file=...|jsonpath=...|jsonpath-file=... See custom columns [http://kubernetes.io/docs/user-guide/kubectl-overview/#custom-columns], golang template [http://golang.org/pkg/text/template/#pkg-overview] and jsonpath template [http://kubernetes.io/docs/user-guide/jsonpath].")
51
+
cmd.Flags().Bool("allow-missing-template-keys", true, "If true, ignore any errors in templates when a field or map key is missing in the template. Only applies to golang and jsonpath output formats.")
51
52
}
52
53
53
54
// AddNoHeadersFlags adds no-headers flags to a command.
return&Result{singular: isSingular, err: fmt.Errorf("when paths, URLs, or stdin is provided as input, you may not specify a resource by arguments as well")}
674
+
return&Result{singleItemImplied: isSingleItemImplied, err: fmt.Errorf("when paths, URLs, or stdin is provided as input, you may not specify a resource by arguments as well")}
675
675
}
676
676
iflen(b.resources) ==0 {
677
-
return&Result{singular: isSingular, err: fmt.Errorf("you must provide a resource and a resource name together")}
677
+
return&Result{singleItemImplied: isSingleItemImplied, err: fmt.Errorf("you must provide a resource and a resource name together")}
678
678
}
679
679
iflen(b.resources) >1 {
680
-
return&Result{singular: isSingular, err: fmt.Errorf("you must specify only one resource")}
680
+
return&Result{singleItemImplied: isSingleItemImplied, err: fmt.Errorf("you must specify only one resource")}
return&Result{singular: singular, err: fmt.Errorf("when paths, URLs, or stdin is provided as input, you may not specify resource arguments as well")}
718
+
return&Result{singleItemImplied: singleItemImplied, err: fmt.Errorf("when paths, URLs, or stdin is provided as input, you may not specify resource arguments as well")}
719
719
}
720
720
iflen(b.names) !=0 {
721
721
return&Result{err: fmt.Errorf("name cannot be provided when a path is specified")}
0 commit comments