cmd.Flags().BoolVar(&options.CreateAnnotation,"create-annotation",options.CreateAnnotation,"Will create 'last-applied-configuration' annotations if current objects doesn't have one")
usage:="that contains the last-applied-configuration annotations"
kubectl.AddJsonFilenameFlag(cmd,&options.FilenameOptions.Filenames,"Filename, directory, or URL to files "+usage)
cmd.Flags().BoolVar(&o.CreateAnnotation,"create-annotation",o.CreateAnnotation,"Will create 'last-applied-configuration' annotations if current objects doesn't have one")
kubectl.AddJsonFilenameFlag(cmd,&o.FilenameOptions.Filenames,"Filename, directory, or URL to files that contains the last-applied-configuration annotations")
returncmdutil.AddSourceToErr(fmt.Sprintf("retrieving current configuration of:\n%s\nfrom server for:",info.String()),info.Source,err)
}
iforiginalBuf==nil&&!o.CreateAnnotation{
returncmdutil.UsageErrorf(cmd,"no last-applied-configuration annotation found on resource: %s, to create the annotation, run the command with --create-annotation",info.Name)
returnfmt.Errorf("no last-applied-configuration annotation found on resource: %s, to create the annotation, run the command with --create-annotation",info.Name)
name:"set for the annotation does not exist on the live object",
filePath:filenameRCNoAnnotation,
expectedErr:"error: no last-applied-configuration annotation found on resource: no-annotation, to create the annotation, run the command with --create-annotation\nSee 'set-last-applied -h' for help and examples.",
expectedErr:"error: no last-applied-configuration annotation found on resource: no-annotation, to create the annotation, run the command with --create-annotation",
cmd.Flags().String("generator",cmdutil.HorizontalPodAutoscalerV1GeneratorName,i18n.T("The name of the API generator to use. Currently there is only 1 generator."))
cmd.Flags().Int32("min",-1,"The lower limit for the number of pods that can be set by the autoscaler. If it's not specified or negative, the server will apply a default value.")
cmd.Flags().Int32("max",-1,"The upper limit for the number of pods that can be set by the autoscaler. Required.")
cmd.Flags().StringVar(&o.Generator,"generator",cmdutil.HorizontalPodAutoscalerV1GeneratorName,i18n.T("The name of the API generator to use. Currently there is only 1 generator."))
cmd.Flags().Int32Var(&o.Min,"min",-1,"The lower limit for the number of pods that can be set by the autoscaler. If it's not specified or negative, the server will apply a default value.")
cmd.Flags().Int32Var(&o.Max,"max",-1,"The upper limit for the number of pods that can be set by the autoscaler. Required.")
cmd.MarkFlagRequired("max")
cmd.Flags().Int32("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, a default autoscaling policy will be used."))
cmd.Flags().String("name","",i18n.T("The name for the newly created object. If not specified, the name of the input resource will be used."))
cmd.Flags().Int32Var(&o.CpuPercent,"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, a default autoscaling policy will be used."))
cmd.Flags().StringVar(&o.Name,"name","",i18n.T("The name for the newly created object. If not specified, the name of the input resource will be used."))
cmd.Flags().String("output-directory","",i18n.T("Where to output the files. If empty or '-' uses stdout, otherwise creates a directory hierarchy in that directory"))
cmd.Flags().StringSlice("namespaces",[]string{},"A comma separated list of namespaces to dump.")
cmd.Flags().Bool("all-namespaces",false,"If true, dump all namespaces. If true, --namespaces is ignored.")
cmd.Flags().StringVar(&o.OutputDir,"output-directory","",i18n.T("Where to output the files. If empty or '-' uses stdout, otherwise creates a directory hierarchy in that directory"))
cmd.Flags().StringSliceVar(&o.Namespaces,"namespaces",[]string{},"A comma separated list of namespaces to dump.")
cmd.Flags().BoolVar(&o.AllNamespaces,"all-namespaces",false,"If true, dump all namespaces. If true, --namespaces is ignored.")
cmd.Flags().IntVar(&o.CurrentReplicas,"current-replicas",o.CurrentReplicas,"Precondition for current size. Requires that the current size of the resource match this value in order to scale.")
cmd.Flags().IntVar(&o.Replicas,"replicas",o.Replicas,"The new desired number of replicas. Required.")
cmd.MarkFlagRequired("replicas")
cmd.Flags().DurationVar(&o.Duration,"timeout",o.Duration,"The length of time to wait before giving up on a scale operation, zero means don't wait. Any other values should contain a corresponding time unit (e.g. 1s, 2m, 3h).")
usage:="identifying the resource to set a new size"
cmd.Flags().DurationVar(&o.Timeout,"timeout",0,"The length of time to wait before giving up on a scale operation, zero means don't wait. Any other values should contain a corresponding time unit (e.g. 1s, 2m, 3h).")
cmdutil.AddFilenameOptionFlags(cmd,&o.FilenameOptions,"identifying the resource to set a new size")
cmd.Flags().BoolVar(&options.All,"all",options.All,"Select all resources, including uninitialized ones, in the namespace of the specified resource types")
cmd.Flags().StringVarP(&options.Selector,"selector","l",options.Selector,"Selector (label query) to filter on, not including uninitialized ones, supports '=', '==', and '!='.(e.g. -l key1=value1,key2=value2)")
cmd.Flags().BoolVar(&options.Local,"local",options.Local,"If true, set subject will NOT contact api-server but run locally.")
cmdutil.AddFilenameOptionFlags(cmd,&o.FilenameOptions,"the resource to update the subjects")
cmd.Flags().BoolVar(&o.All,"all",o.All,"Select all resources, including uninitialized ones, in the namespace of the specified resource types")
cmd.Flags().StringVarP(&o.Selector,"selector","l",o.Selector,"Selector (label query) to filter on, not including uninitialized ones, supports '=', '==', and '!='.(e.g. -l key1=value1,key2=value2)")
cmd.Flags().BoolVar(&o.Local,"local",o.Local,"If true, set subject will NOT contact api-server but run locally.")
cmdutil.AddDryRunFlag(cmd)
cmd.Flags().StringArrayVar(&options.Users,"user",options.Users,"Usernames to bind to the role")
cmd.Flags().StringArrayVar(&options.Groups,"group",options.Groups,"Groups to bind to the role")
cmd.Flags().StringArrayVar(&options.ServiceAccounts,"serviceaccount",options.ServiceAccounts,"Service accounts to bind to the role")
cmd.Flags().StringArrayVar(&o.Users,"user",o.Users,"Usernames to bind to the role")
cmd.Flags().StringArrayVar(&o.Groups,"group",o.Groups,"Groups to bind to the role")
cmd.Flags().StringArrayVar(&o.ServiceAccounts,"serviceaccount",o.ServiceAccounts,"Service accounts to bind to the role")