mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-08-18 08:09:58 +00:00
return all the invalid parameters for set_image
Signed-off-by: PingWang <wang.ping5@zte.com.cn>
This commit is contained in:
parent
6fcbbe8663
commit
8ec61c1dce
@ -147,15 +147,16 @@ func (o *ImageOptions) Complete(f *cmdutil.Factory, cmd *cobra.Command, args []s
|
||||
}
|
||||
|
||||
func (o *ImageOptions) Validate() error {
|
||||
errors := []error{}
|
||||
if len(o.Resources) < 1 && len(o.Filenames) == 0 {
|
||||
return fmt.Errorf("one or more resources must be specified as <resource> <name> or <resource>/<name>")
|
||||
errors = append(errors, fmt.Errorf("one or more resources must be specified as <resource> <name> or <resource>/<name>"))
|
||||
}
|
||||
if len(o.ContainerImages) < 1 {
|
||||
return fmt.Errorf("at least one image update is required")
|
||||
errors = append(errors, fmt.Errorf("at least one image update is required"))
|
||||
} else if len(o.ContainerImages) > 1 && hasWildcardKey(o.ContainerImages) {
|
||||
return fmt.Errorf("all containers are already specified by *, but saw more than one container_name=container_image pairs")
|
||||
errors = append(errors, fmt.Errorf("all containers are already specified by *, but saw more than one container_name=container_image pairs"))
|
||||
}
|
||||
return nil
|
||||
return utilerrors.NewAggregate(errors)
|
||||
}
|
||||
|
||||
func (o *ImageOptions) Run() error {
|
||||
|
Loading…
Reference in New Issue
Block a user