• Kubernetes Submit Queue's avatar
    Merge pull request #64371 from CaoShuFeng/invalid_o · bf422b7b
    Kubernetes Submit Queue authored
    Automatic merge from submit-queue. If you want to cherry-pick this change to another branch, please follow the instructions <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md">here</a>.
    
    fix kubectl -o
    
    Fix kubectl -o error message:
    Before this change:
    ```
    kubectl get pods -o foo
    error: unable to match a printer suitable for the output format "" and the options specified: &get.PrintFlags{JSONYamlPrintFlags:(*genericclioptions.JSONYamlPrintFlags)(0x23aa610), NamePrintFlags:(*genericclioptions.NamePrintFlags)(0xc42058b4e0), TemplateFlags:(*printers.KubeTemplatePrintFlags)(0xc4206765e0), CustomColumnsFlags:(*printers.CustomColumnsPrintFlags)(0xc420676620), HumanReadableFlags:(*get.HumanPrintFlags)(0xc4204eb180), NoHeaders:(*bool)(0xc4206fefbc), OutputFormat:(*string)(0xc42058b4d0)}
    ```
    
    After this change:
    ```
    Kubectl get pods -o foo
    error: unable to match a printer suitable for the output format "foo", allowed formats are: json,yaml,name,template,go-template,go-template-file,templatefile,jsonpath,jsonpath-file,custom-columns-file,custom-columns,wide
    ```
    
    
    
    **What this PR does / why we need it**:
    
    **Which issue(s) this PR fixes** *(optional, in `fixes #<issue number>(, fixes #<issue_number>, ...)` format, will close the issue(s) when PR gets merged)*:
    Fixes #
    
    **Special notes for your reviewer**:
    
    **Release note**:
    
    ```release-note
    kubectl will list all allowed print formats when an invalid format is passed.
    ```
    bf422b7b
Name
Last commit
Last update
..
auth Loading commit data...
config Loading commit data...
create Loading commit data...
get Loading commit data...
rollout Loading commit data...
scalejob Loading commit data...
set Loading commit data...
templates Loading commit data...
testdata/edit Loading commit data...
testing Loading commit data...
util Loading commit data...
wait Loading commit data...
BUILD Loading commit data...
alpha.go Loading commit data...
annotate.go Loading commit data...
annotate_test.go Loading commit data...
apiresources.go Loading commit data...
apiversions.go Loading commit data...
apply.go Loading commit data...
apply_edit_last_applied.go Loading commit data...
apply_set_last_applied.go Loading commit data...
apply_test.go Loading commit data...
apply_view_last_applied.go Loading commit data...
attach.go Loading commit data...
attach_test.go Loading commit data...
autoscale.go Loading commit data...
certificates.go Loading commit data...
clusterinfo.go Loading commit data...
clusterinfo_dump.go Loading commit data...
clusterinfo_dump_test.go Loading commit data...
cmd.go Loading commit data...
cmd_printing_test.go Loading commit data...
cmd_test.go Loading commit data...
completion.go Loading commit data...
convert.go Loading commit data...
convert_test.go Loading commit data...
cp.go Loading commit data...
cp_test.go Loading commit data...
delete.go Loading commit data...
delete_flags.go Loading commit data...
delete_test.go Loading commit data...
describe.go Loading commit data...
describe_test.go Loading commit data...
diff.go Loading commit data...
diff_test.go Loading commit data...
drain.go Loading commit data...
drain_test.go Loading commit data...
edit.go Loading commit data...
edit_test.go Loading commit data...
exec.go Loading commit data...
exec_test.go Loading commit data...
explain.go Loading commit data...
expose.go Loading commit data...
expose_test.go Loading commit data...
help.go Loading commit data...
label.go Loading commit data...
label_test.go Loading commit data...
logs.go Loading commit data...
logs_test.go Loading commit data...
options.go Loading commit data...
patch.go Loading commit data...
patch_test.go Loading commit data...
plugin.go Loading commit data...
plugin_test.go Loading commit data...
portforward.go Loading commit data...
portforward_test.go Loading commit data...
proxy.go Loading commit data...
replace.go Loading commit data...
replace_test.go Loading commit data...
rollingupdate.go Loading commit data...
rollingupdate_test.go Loading commit data...
run.go Loading commit data...
run_test.go Loading commit data...
scale.go Loading commit data...
taint.go Loading commit data...
taint_test.go Loading commit data...
top.go Loading commit data...
top_node.go Loading commit data...
top_node_test.go Loading commit data...
top_pod.go Loading commit data...
top_pod_test.go Loading commit data...
top_test.go Loading commit data...
version.go Loading commit data...