mirror of
https://github.com/k3s-io/kubernetes.git
synced 2026-01-05 07:27:21 +00:00
change to stderr
This commit is contained in:
@@ -74,7 +74,7 @@ var (
|
||||
kubectl describe pods frontend`)
|
||||
)
|
||||
|
||||
func NewCmdDescribe(f *cmdutil.Factory, out io.Writer) *cobra.Command {
|
||||
func NewCmdDescribe(f *cmdutil.Factory, out, cmdErr io.Writer) *cobra.Command {
|
||||
options := &DescribeOptions{}
|
||||
describerSettings := &kubectl.DescriberSettings{}
|
||||
|
||||
@@ -87,7 +87,7 @@ func NewCmdDescribe(f *cmdutil.Factory, out io.Writer) *cobra.Command {
|
||||
Long: describe_long,
|
||||
Example: describe_example,
|
||||
Run: func(cmd *cobra.Command, args []string) {
|
||||
err := RunDescribe(f, out, cmd, args, options, describerSettings)
|
||||
err := RunDescribe(f, out, cmdErr, cmd, args, options, describerSettings)
|
||||
cmdutil.CheckErr(err)
|
||||
},
|
||||
ValidArgs: validArgs,
|
||||
@@ -103,7 +103,7 @@ func NewCmdDescribe(f *cmdutil.Factory, out io.Writer) *cobra.Command {
|
||||
return cmd
|
||||
}
|
||||
|
||||
func RunDescribe(f *cmdutil.Factory, out io.Writer, cmd *cobra.Command, args []string, options *DescribeOptions, describerSettings *kubectl.DescriberSettings) error {
|
||||
func RunDescribe(f *cmdutil.Factory, out, cmdErr io.Writer, cmd *cobra.Command, args []string, options *DescribeOptions, describerSettings *kubectl.DescriberSettings) error {
|
||||
selector := cmdutil.GetFlagString(cmd, "selector")
|
||||
allNamespaces := cmdutil.GetFlagBool(cmd, "all-namespaces")
|
||||
cmdNamespace, enforceNamespace, err := f.DefaultNamespace()
|
||||
@@ -114,7 +114,7 @@ func RunDescribe(f *cmdutil.Factory, out io.Writer, cmd *cobra.Command, args []s
|
||||
enforceNamespace = false
|
||||
}
|
||||
if len(args) == 0 && len(options.Filenames) == 0 {
|
||||
fmt.Fprint(out, "You must specify the type of resource to describe. ", valid_resources)
|
||||
fmt.Fprint(cmdErr, "You must specify the type of resource to describe. ", valid_resources)
|
||||
return cmdutil.UsageError(cmd, "Required resource not specified.")
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user