mirror of
https://github.com/optim-enterprises-bv/kubernetes.git
synced 2025-11-01 18:58:18 +00:00
Add 'kubectl set image'
This commit is contained in:
@@ -68,7 +68,7 @@ func NewCmdAutoscale(f *cmdutil.Factory, out io.Writer) *cobra.Command {
|
||||
cmd.MarkFlagRequired("max")
|
||||
cmd.Flags().Int("cpu-percent", -1, fmt.Sprintf("The target average CPU utilization (represented as a percent of requested CPU) over all the pods. If it's not specified or negative, the server will apply a default value."))
|
||||
cmd.Flags().String("name", "", "The name for the newly created object. If not specified, the name of the input resource will be used.")
|
||||
cmd.Flags().Bool("dry-run", false, "If true, only print the object that would be sent, without creating it.")
|
||||
cmdutil.AddDryRunFlag(cmd)
|
||||
usage := "Filename, directory, or URL to a file identifying the resource to autoscale."
|
||||
kubectl.AddJsonFilenameFlag(cmd, &options.Filenames, usage)
|
||||
cmdutil.AddRecursiveFlag(cmd, &options.Recursive)
|
||||
@@ -160,8 +160,7 @@ func RunAutoscale(f *cmdutil.Factory, out io.Writer, cmd *cobra.Command, args []
|
||||
}
|
||||
object = hpa.Object
|
||||
}
|
||||
// TODO: extract this flag to a central location, when such a location exists.
|
||||
if cmdutil.GetFlagBool(cmd, "dry-run") {
|
||||
if cmdutil.GetDryRunFlag(cmd) {
|
||||
return f.PrintObject(cmd, mapper, object, out)
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user