Merge pull request #45285 from suyogbarve/master

Automatic merge from submit-queue

use of --local should completely eliminate communication with API server

This PR is a bug fix for #45223 
It allows --local flag to completely avoid communication with api server. 

**Which issue this PR fixes** *(optional, in `fixes #<issue number>(, fixes #<issue_number>, ...)` format, will close that issue when PR gets merged)*: fixes #

fixes #45223

This is a simple change, to set the value of boolean flag "local" on o.Local variable
This commit is contained in:
Kubernetes Submit Queue 2017-05-04 01:40:20 -07:00 committed by GitHub
commit 3b8aac9b22
3 changed files with 3 additions and 0 deletions

View File

@ -121,6 +121,7 @@ func (o *ImageOptions) Complete(f cmdutil.Factory, cmd *cobra.Command, args []st
o.Record = cmdutil.GetRecordFlag(cmd)
o.ChangeCause = f.Command(cmd, false)
o.PrintObject = f.PrintObject
o.Local = cmdutil.GetFlagBool(cmd, "local")
o.DryRun = cmdutil.GetDryRunFlag(cmd)
o.Output = cmdutil.GetFlagString(cmd, "output")
o.ResolveImage = f.ResolveImage

View File

@ -48,6 +48,7 @@ func TestImageLocal(t *testing.T) {
cmd := NewCmdImage(f, buf, buf)
cmd.SetOutput(buf)
cmd.Flags().Set("output", "name")
cmd.Flags().Set("local", "true")
mapper, typer := f.Object()
tf.Printer = &printers.NamePrinter{Decoders: []runtime.Decoder{codec}, Typer: typer, Mapper: mapper}

View File

@ -131,6 +131,7 @@ func (o *ResourcesOptions) Complete(f cmdutil.Factory, cmd *cobra.Command, args
o.Encoder = f.JSONEncoder()
o.ShortOutput = cmdutil.GetFlagString(cmd, "output") == "name"
o.Record = cmdutil.GetRecordFlag(cmd)
o.Local = cmdutil.GetFlagBool(cmd, "local")
o.ChangeCause = f.Command(cmd, false)
o.PrintObject = f.PrintObject
o.Cmd = cmd