Skip to content

Commit

Permalink
Merge pull request #1909 from hanweisen/cleanup
Browse files Browse the repository at this point in the history
delete unused parameter
  • Loading branch information
karmada-bot authored May 30, 2022
2 parents 4eba0e5 + b8abd53 commit 22b368a
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 6 deletions.
4 changes: 2 additions & 2 deletions pkg/karmadactl/describe.go
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down Expand Up @@ -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 {
Expand Down
4 changes: 2 additions & 2 deletions pkg/karmadactl/exec.go
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down Expand Up @@ -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]
}
Expand Down
4 changes: 2 additions & 2 deletions pkg/karmadactl/get.go
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down Expand Up @@ -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 := ""
Expand Down

0 comments on commit 22b368a

Please sign in to comment.