Commit cb6f32e8 authored by Kubernetes Submit Queue's avatar Kubernetes Submit Queue Committed by GitHub

Merge pull request #50841 from zjj2wry/kubectl-set-image-ignoring

Automatic merge from submit-queue (batch tested with PRs 50872, 51103, 51220, 51285, 50841) Fix issue(#49695)kubectl set image deployment is ignoring --selector **What this PR does / why we need it**: closes #49695 **Which issue this PR fixes** *(optional, in `fixes #<issue number>(, fixes #<issue_number>, ...)` format, will close that issue when PR gets merged)*: fixes # **Special notes for your reviewer**: **Release note**: ```release-note NONE ```
parents 0a51ba11 1d7328a2
...@@ -229,7 +229,10 @@ func (o *ImageOptions) Run() error { ...@@ -229,7 +229,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
...@@ -252,7 +255,10 @@ func (o *ImageOptions) Run() error { ...@@ -252,7 +255,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")
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment