diff --git a/pkg/karmadactl/describe.go b/pkg/karmadactl/describe.go index 3f0a08cd3fd1..3c7c404276bb 100644 --- a/pkg/karmadactl/describe.go +++ b/pkg/karmadactl/describe.go @@ -39,7 +39,7 @@ func NewCmdDescribe(karmadaConfig KarmadaConfig, parentCommand string) *cobra.Co SilenceUsage: true, Example: describeExample(parentCommand), RunE: func(cmd *cobra.Command, args []string) error { - if err := o.Complete(karmadaConfig, cmd, args); err != nil { + if err := o.Complete(karmadaConfig, args); err != nil { return err } if err := o.Run(); err != nil { @@ -107,7 +107,7 @@ func describeExample(parentCommand string) string { } // Complete ensures that options are valid and marshals them if necessary -func (o *CommandDescribeOptions) Complete(karmadaConfig KarmadaConfig, cmd *cobra.Command, args []string) error { +func (o *CommandDescribeOptions) Complete(karmadaConfig KarmadaConfig, args []string) error { var err error if len(o.Cluster) == 0 { diff --git a/pkg/karmadactl/exec.go b/pkg/karmadactl/exec.go index 00e1f0ae9843..bf34c3b6c5b2 100644 --- a/pkg/karmadactl/exec.go +++ b/pkg/karmadactl/exec.go @@ -48,7 +48,7 @@ func NewCmdExec(karmadaConfig KarmadaConfig, parentCommand string) *cobra.Comman Example: execExample(parentCommand), RunE: func(cmd *cobra.Command, args []string) error { argsLenAtDash := cmd.ArgsLenAtDash() - if err := o.Complete(karmadaConfig, cmd, args, argsLenAtDash); err != nil { + if err := o.Complete(karmadaConfig, args, argsLenAtDash); err != nil { return err } if err := o.Validate(cmd); err != nil { @@ -159,7 +159,7 @@ type ExecOptions struct { } // Complete verifies command line arguments and loads data from the command environment -func (p *ExecOptions) Complete(karmadaConfig KarmadaConfig, cmd *cobra.Command, argsIn []string, argsLenAtDash int) error { +func (p *ExecOptions) Complete(karmadaConfig KarmadaConfig, argsIn []string, argsLenAtDash int) error { if len(argsIn) > 0 && argsLenAtDash != 0 { p.ResourceName = argsIn[0] } diff --git a/pkg/karmadactl/get.go b/pkg/karmadactl/get.go index e9a0735318ad..ffbabc6a2f07 100644 --- a/pkg/karmadactl/get.go +++ b/pkg/karmadactl/get.go @@ -71,7 +71,7 @@ func NewCmdGet(karmadaConfig KarmadaConfig, parentCommand string) *cobra.Command SilenceUsage: true, Example: getExample(parentCommand), RunE: func(cmd *cobra.Command, args []string) error { - if err := o.Complete(cmd, args); err != nil { + if err := o.Complete(); err != nil { return err } if err := o.Validate(cmd); err != nil { @@ -152,7 +152,7 @@ func NewCommandGetOptions(parent string, streams genericclioptions.IOStreams) *C } // Complete takes the command arguments and infers any remaining options. -func (g *CommandGetOptions) Complete(cmd *cobra.Command, args []string) error { +func (g *CommandGetOptions) Complete() error { newScheme := gclient.NewSchema() templateArg := ""