mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-09-24 03:18:57 +00:00
fix issue(#49695)kubectl set image deployment is ignoring --selector
This commit is contained in:
@@ -227,7 +227,10 @@ func (o *ImageOptions) Run() error {
|
||||
}
|
||||
|
||||
if o.PrintObject != nil && (o.Local || o.DryRun) {
|
||||
return o.PrintObject(o.Cmd, o.Local, o.Mapper, info.Object, o.Out)
|
||||
if err := o.PrintObject(o.Cmd, o.Local, o.Mapper, info.Object, o.Out); err != nil {
|
||||
return err
|
||||
}
|
||||
continue
|
||||
}
|
||||
|
||||
// patch the change
|
||||
@@ -250,7 +253,10 @@ func (o *ImageOptions) Run() error {
|
||||
info.Refresh(obj, true)
|
||||
|
||||
if len(o.Output) > 0 {
|
||||
return o.PrintObject(o.Cmd, o.Local, o.Mapper, obj, o.Out)
|
||||
if err := o.PrintObject(o.Cmd, o.Local, o.Mapper, obj, o.Out); err != nil {
|
||||
return err
|
||||
}
|
||||
continue
|
||||
}
|
||||
cmdutil.PrintSuccess(o.Mapper, o.ShortOutput, o.Out, info.Mapping.Resource, info.Name, o.DryRun, "image updated")
|
||||
}
|
||||
|
Reference in New Issue
Block a user