Merge pull request #1909 from hanweisen/cleanup
delete unused parameter
This commit is contained in:
commit
22b368abb4
|
@ -39,7 +39,7 @@ func NewCmdDescribe(karmadaConfig KarmadaConfig, parentCommand string) *cobra.Co
|
||||||
SilenceUsage: true,
|
SilenceUsage: true,
|
||||||
Example: describeExample(parentCommand),
|
Example: describeExample(parentCommand),
|
||||||
RunE: func(cmd *cobra.Command, args []string) error {
|
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
|
return err
|
||||||
}
|
}
|
||||||
if err := o.Run(); err != nil {
|
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
|
// 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
|
var err error
|
||||||
|
|
||||||
if len(o.Cluster) == 0 {
|
if len(o.Cluster) == 0 {
|
||||||
|
|
|
@ -48,7 +48,7 @@ func NewCmdExec(karmadaConfig KarmadaConfig, parentCommand string) *cobra.Comman
|
||||||
Example: execExample(parentCommand),
|
Example: execExample(parentCommand),
|
||||||
RunE: func(cmd *cobra.Command, args []string) error {
|
RunE: func(cmd *cobra.Command, args []string) error {
|
||||||
argsLenAtDash := cmd.ArgsLenAtDash()
|
argsLenAtDash := cmd.ArgsLenAtDash()
|
||||||
if err := o.Complete(karmadaConfig, cmd, args, argsLenAtDash); err != nil {
|
if err := o.Complete(karmadaConfig, args, argsLenAtDash); err != nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
if err := o.Validate(cmd); err != nil {
|
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
|
// 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 {
|
if len(argsIn) > 0 && argsLenAtDash != 0 {
|
||||||
p.ResourceName = argsIn[0]
|
p.ResourceName = argsIn[0]
|
||||||
}
|
}
|
||||||
|
|
|
@ -71,7 +71,7 @@ func NewCmdGet(karmadaConfig KarmadaConfig, parentCommand string) *cobra.Command
|
||||||
SilenceUsage: true,
|
SilenceUsage: true,
|
||||||
Example: getExample(parentCommand),
|
Example: getExample(parentCommand),
|
||||||
RunE: func(cmd *cobra.Command, args []string) error {
|
RunE: func(cmd *cobra.Command, args []string) error {
|
||||||
if err := o.Complete(cmd, args); err != nil {
|
if err := o.Complete(); err != nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
if err := o.Validate(cmd); err != nil {
|
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.
|
// 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()
|
newScheme := gclient.NewSchema()
|
||||||
|
|
||||||
templateArg := ""
|
templateArg := ""
|
||||||
|
|
Loading…
Reference in New Issue