mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-09-02 01:39:02 +00:00
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:
@@ -121,6 +121,7 @@ func (o *ImageOptions) Complete(f cmdutil.Factory, cmd *cobra.Command, args []st
|
|||||||
o.Record = cmdutil.GetRecordFlag(cmd)
|
o.Record = cmdutil.GetRecordFlag(cmd)
|
||||||
o.ChangeCause = f.Command(cmd, false)
|
o.ChangeCause = f.Command(cmd, false)
|
||||||
o.PrintObject = f.PrintObject
|
o.PrintObject = f.PrintObject
|
||||||
|
o.Local = cmdutil.GetFlagBool(cmd, "local")
|
||||||
o.DryRun = cmdutil.GetDryRunFlag(cmd)
|
o.DryRun = cmdutil.GetDryRunFlag(cmd)
|
||||||
o.Output = cmdutil.GetFlagString(cmd, "output")
|
o.Output = cmdutil.GetFlagString(cmd, "output")
|
||||||
o.ResolveImage = f.ResolveImage
|
o.ResolveImage = f.ResolveImage
|
||||||
|
@@ -48,6 +48,7 @@ func TestImageLocal(t *testing.T) {
|
|||||||
cmd := NewCmdImage(f, buf, buf)
|
cmd := NewCmdImage(f, buf, buf)
|
||||||
cmd.SetOutput(buf)
|
cmd.SetOutput(buf)
|
||||||
cmd.Flags().Set("output", "name")
|
cmd.Flags().Set("output", "name")
|
||||||
|
cmd.Flags().Set("local", "true")
|
||||||
mapper, typer := f.Object()
|
mapper, typer := f.Object()
|
||||||
tf.Printer = &printers.NamePrinter{Decoders: []runtime.Decoder{codec}, Typer: typer, Mapper: mapper}
|
tf.Printer = &printers.NamePrinter{Decoders: []runtime.Decoder{codec}, Typer: typer, Mapper: mapper}
|
||||||
|
|
||||||
|
@@ -131,6 +131,7 @@ func (o *ResourcesOptions) Complete(f cmdutil.Factory, cmd *cobra.Command, args
|
|||||||
o.Encoder = f.JSONEncoder()
|
o.Encoder = f.JSONEncoder()
|
||||||
o.ShortOutput = cmdutil.GetFlagString(cmd, "output") == "name"
|
o.ShortOutput = cmdutil.GetFlagString(cmd, "output") == "name"
|
||||||
o.Record = cmdutil.GetRecordFlag(cmd)
|
o.Record = cmdutil.GetRecordFlag(cmd)
|
||||||
|
o.Local = cmdutil.GetFlagBool(cmd, "local")
|
||||||
o.ChangeCause = f.Command(cmd, false)
|
o.ChangeCause = f.Command(cmd, false)
|
||||||
o.PrintObject = f.PrintObject
|
o.PrintObject = f.PrintObject
|
||||||
o.Cmd = cmd
|
o.Cmd = cmd
|
||||||
|
Reference in New Issue
Block a user