From 1d7328a290afae198aaf7ca97896307afe6c6de1 Mon Sep 17 00:00:00 2001 From: zhengjiajin Date: Thu, 17 Aug 2017 19:56:25 +0800 Subject: [PATCH] fix issue(#49695)kubectl set image deployment is ignoring --selector --- pkg/kubectl/cmd/set/set_image.go | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/pkg/kubectl/cmd/set/set_image.go b/pkg/kubectl/cmd/set/set_image.go index 6fe353943c1..8a2b5d34327 100644 --- a/pkg/kubectl/cmd/set/set_image.go +++ b/pkg/kubectl/cmd/set/set_image.go @@ -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") }