mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-07-24 20:24:09 +00:00
Merge pull request #32230 from juanvallejo/jvallejo_update-kubectl-expose-output-to-usage-error
Automatic merge from submit-queue update `kubectl expose` output to UsageError **Release note**: ```release-note NONE ``` This patch updates `kubectl expose` output (with no resources provided) to a UsageError so that the `kubectl expose -h` suggestion is displayed. ##### Before `$ kubectl expose` ``` error: You must provide one or more resources by argument or filename. Example resource specifications include: '-f rsrc.yaml' '--filename=rsrc.json' 'pods my-pod' 'services' ``` ##### After ``` error: You must provide one or more resources by argument or filename. Example resource specifications include: '-f rsrc.yaml' '--filename=rsrc.json' 'pods my-pod' 'services' See 'kubectl expose -h' for help and examples. ```
This commit is contained in:
commit
a7571aa367
@ -147,7 +147,7 @@ func RunExpose(f *cmdutil.Factory, out io.Writer, cmd *cobra.Command, args []str
|
||||
Do()
|
||||
err = r.Err()
|
||||
if err != nil {
|
||||
return err
|
||||
return cmdutil.UsageError(cmd, err.Error())
|
||||
}
|
||||
|
||||
// Get the generator, setup and validate all required parameters
|
||||
|
Loading…
Reference in New Issue
Block a user