mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-07-26 21:17:23 +00:00
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:
commit
3b8aac9b22
@ -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
|
||||||
|
Loading…
Reference in New Issue
Block a user