mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-08-11 21:12:07 +00:00
Use GetDryRunFlag to keep consistent
This commit is contained in:
parent
035ff73f7b
commit
86cc625a55
@ -233,7 +233,7 @@ func RunApply(f cmdutil.Factory, cmd *cobra.Command, out, errOut io.Writer, opti
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
dryRun := cmdutil.GetFlagBool(cmd, "dry-run")
|
dryRun := cmdutil.GetDryRunFlag(cmd)
|
||||||
output := cmdutil.GetFlagString(cmd, "output")
|
output := cmdutil.GetFlagString(cmd, "output")
|
||||||
shortOutput := output == "name"
|
shortOutput := output == "name"
|
||||||
|
|
||||||
|
@ -106,7 +106,7 @@ func NewCmdApplySetLastApplied(f cmdutil.Factory, out, err io.Writer) *cobra.Com
|
|||||||
}
|
}
|
||||||
|
|
||||||
func (o *SetLastAppliedOptions) Complete(f cmdutil.Factory, cmd *cobra.Command) error {
|
func (o *SetLastAppliedOptions) Complete(f cmdutil.Factory, cmd *cobra.Command) error {
|
||||||
o.DryRun = cmdutil.GetFlagBool(cmd, "dry-run")
|
o.DryRun = cmdutil.GetDryRunFlag(cmd)
|
||||||
o.Output = cmdutil.GetFlagString(cmd, "output")
|
o.Output = cmdutil.GetFlagString(cmd, "output")
|
||||||
o.ShortOutput = o.Output == "name"
|
o.ShortOutput = o.Output == "name"
|
||||||
o.Codec = f.JSONEncoder()
|
o.Codec = f.JSONEncoder()
|
||||||
|
@ -198,7 +198,7 @@ func RunCreate(f cmdutil.Factory, cmd *cobra.Command, out, errOut io.Writer, opt
|
|||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
|
||||||
dryRun := cmdutil.GetFlagBool(cmd, "dry-run")
|
dryRun := cmdutil.GetDryRunFlag(cmd)
|
||||||
output := cmdutil.GetFlagString(cmd, "output")
|
output := cmdutil.GetFlagString(cmd, "output")
|
||||||
mapper := r.Mapper().RESTMapper
|
mapper := r.Mapper().RESTMapper
|
||||||
|
|
||||||
|
@ -93,7 +93,7 @@ func CreatePodDisruptionBudget(f cmdutil.Factory, cmdOut io.Writer, cmd *cobra.C
|
|||||||
return RunCreateSubcommand(f, cmd, cmdOut, &CreateSubcommandOptions{
|
return RunCreateSubcommand(f, cmd, cmdOut, &CreateSubcommandOptions{
|
||||||
Name: name,
|
Name: name,
|
||||||
StructuredGenerator: generator,
|
StructuredGenerator: generator,
|
||||||
DryRun: cmdutil.GetFlagBool(cmd, "dry-run"),
|
DryRun: cmdutil.GetDryRunFlag(cmd),
|
||||||
OutputFormat: cmdutil.GetFlagString(cmd, "output"),
|
OutputFormat: cmdutil.GetFlagString(cmd, "output"),
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
@ -84,7 +84,7 @@ func CreatePriorityClass(f cmdutil.Factory, cmdOut io.Writer, cmd *cobra.Command
|
|||||||
return RunCreateSubcommand(f, cmd, cmdOut, &CreateSubcommandOptions{
|
return RunCreateSubcommand(f, cmd, cmdOut, &CreateSubcommandOptions{
|
||||||
Name: name,
|
Name: name,
|
||||||
StructuredGenerator: generator,
|
StructuredGenerator: generator,
|
||||||
DryRun: cmdutil.GetFlagBool(cmd, "dry-run"),
|
DryRun: cmdutil.GetDryRunFlag(cmd),
|
||||||
OutputFormat: cmdutil.GetFlagString(cmd, "output"),
|
OutputFormat: cmdutil.GetFlagString(cmd, "output"),
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
@ -82,7 +82,7 @@ func CreateQuota(f cmdutil.Factory, cmdOut io.Writer, cmd *cobra.Command, args [
|
|||||||
return RunCreateSubcommand(f, cmd, cmdOut, &CreateSubcommandOptions{
|
return RunCreateSubcommand(f, cmd, cmdOut, &CreateSubcommandOptions{
|
||||||
Name: name,
|
Name: name,
|
||||||
StructuredGenerator: generator,
|
StructuredGenerator: generator,
|
||||||
DryRun: cmdutil.GetFlagBool(cmd, "dry-run"),
|
DryRun: cmdutil.GetDryRunFlag(cmd),
|
||||||
OutputFormat: cmdutil.GetFlagString(cmd, "output"),
|
OutputFormat: cmdutil.GetFlagString(cmd, "output"),
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
@ -269,7 +269,7 @@ func CreateSecretTLS(f cmdutil.Factory, cmdOut io.Writer, cmd *cobra.Command, ar
|
|||||||
return RunCreateSubcommand(f, cmd, cmdOut, &CreateSubcommandOptions{
|
return RunCreateSubcommand(f, cmd, cmdOut, &CreateSubcommandOptions{
|
||||||
Name: name,
|
Name: name,
|
||||||
StructuredGenerator: generator,
|
StructuredGenerator: generator,
|
||||||
DryRun: cmdutil.GetFlagBool(cmd, "dry-run"),
|
DryRun: cmdutil.GetDryRunFlag(cmd),
|
||||||
OutputFormat: cmdutil.GetFlagString(cmd, "output"),
|
OutputFormat: cmdutil.GetFlagString(cmd, "output"),
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
@ -219,7 +219,7 @@ func CreateServiceLoadBalancer(f cmdutil.Factory, cmdOut io.Writer, cmd *cobra.C
|
|||||||
return RunCreateSubcommand(f, cmd, cmdOut, &CreateSubcommandOptions{
|
return RunCreateSubcommand(f, cmd, cmdOut, &CreateSubcommandOptions{
|
||||||
Name: name,
|
Name: name,
|
||||||
StructuredGenerator: generator,
|
StructuredGenerator: generator,
|
||||||
DryRun: cmdutil.GetFlagBool(cmd, "dry-run"),
|
DryRun: cmdutil.GetDryRunFlag(cmd),
|
||||||
OutputFormat: cmdutil.GetFlagString(cmd, "output"),
|
OutputFormat: cmdutil.GetFlagString(cmd, "output"),
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
@ -217,7 +217,7 @@ func (o *DrainOptions) SetupDrain(cmd *cobra.Command, args []string) error {
|
|||||||
return cmdutil.UsageErrorf(cmd, fmt.Sprintf("USAGE: %s [flags]", cmd.Use))
|
return cmdutil.UsageErrorf(cmd, fmt.Sprintf("USAGE: %s [flags]", cmd.Use))
|
||||||
}
|
}
|
||||||
|
|
||||||
o.DryRun = cmdutil.GetFlagBool(cmd, "dry-run")
|
o.DryRun = cmdutil.GetDryRunFlag(cmd)
|
||||||
|
|
||||||
if o.client, err = o.Factory.KubernetesClientSet(); err != nil {
|
if o.client, err = o.Factory.KubernetesClientSet(); err != nil {
|
||||||
return err
|
return err
|
||||||
|
@ -105,7 +105,7 @@ func (o *UndoOptions) CompleteUndo(f cmdutil.Factory, cmd *cobra.Command, out io
|
|||||||
o.ToRevision = cmdutil.GetFlagInt64(cmd, "to-revision")
|
o.ToRevision = cmdutil.GetFlagInt64(cmd, "to-revision")
|
||||||
o.Mapper, o.Typer = f.Object()
|
o.Mapper, o.Typer = f.Object()
|
||||||
o.Out = out
|
o.Out = out
|
||||||
o.DryRun = cmdutil.GetFlagBool(cmd, "dry-run")
|
o.DryRun = cmdutil.GetDryRunFlag(cmd)
|
||||||
|
|
||||||
cmdNamespace, enforceNamespace, err := f.DefaultNamespace()
|
cmdNamespace, enforceNamespace, err := f.DefaultNamespace()
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
Loading…
Reference in New Issue
Block a user