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

fix testcase use of --local should completely eliminate communication with API server
This commit is contained in:
Suyog Barve 2017-05-03 09:04:21 -05:00
parent fcd9b7f7ba
commit 05131c627f
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