mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-08-09 20:17:41 +00:00
fix issue(#49695)kubectl set image deployment is ignoring --selector
This commit is contained in:
parent
4bfe9b1a56
commit
1d7328a290
@ -227,7 +227,10 @@ func (o *ImageOptions) Run() error {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if o.PrintObject != nil && (o.Local || o.DryRun) {
|
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
|
// patch the change
|
||||||
@ -250,7 +253,10 @@ func (o *ImageOptions) Run() error {
|
|||||||
info.Refresh(obj, true)
|
info.Refresh(obj, true)
|
||||||
|
|
||||||
if len(o.Output) > 0 {
|
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")
|
cmdutil.PrintSuccess(o.Mapper, o.ShortOutput, o.Out, info.Mapping.Resource, info.Name, o.DryRun, "image updated")
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user