• 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
..
BUILD Loading commit data...
config.go Loading commit data...
config_test.go Loading commit data...
create_authinfo.go Loading commit data...
create_authinfo_test.go Loading commit data...
create_cluster.go Loading commit data...
create_cluster_test.go Loading commit data...
create_context.go Loading commit data...
create_context_test.go Loading commit data...
current_context.go Loading commit data...
current_context_test.go Loading commit data...
delete_cluster.go Loading commit data...
delete_cluster_test.go Loading commit data...
delete_context.go Loading commit data...
delete_context_test.go Loading commit data...
flags.go Loading commit data...
get_clusters.go Loading commit data...
get_clusters_test.go Loading commit data...
get_contexts.go Loading commit data...
get_contexts_test.go Loading commit data...
navigation_step_parser.go Loading commit data...
navigation_step_parser_test.go Loading commit data...
rename_context.go Loading commit data...
rename_context_test.go Loading commit data...
set.go Loading commit data...
set_test.go Loading commit data...
unset.go Loading commit data...
unset_test.go Loading commit data...
use_context.go Loading commit data...
use_context_test.go Loading commit data...
view.go Loading commit data...
view_test.go Loading commit data...