mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-07-22 19:31:44 +00:00
Merge pull request #99892 from changshuchao/last-applied
code cleanup for kubectl apply_edit_last_applied.go ,completion.go,cp.go,wait.go
This commit is contained in:
commit
87e7f749a8
@ -67,12 +67,8 @@ func NewCmdApplyEditLastApplied(f cmdutil.Factory, ioStreams genericclioptions.I
|
||||
Long: applyEditLastAppliedLong,
|
||||
Example: applyEditLastAppliedExample,
|
||||
Run: func(cmd *cobra.Command, args []string) {
|
||||
if err := o.Complete(f, args, cmd); err != nil {
|
||||
cmdutil.CheckErr(err)
|
||||
}
|
||||
if err := o.Run(); err != nil {
|
||||
cmdutil.CheckErr(err)
|
||||
}
|
||||
cmdutil.CheckErr(o.Complete(f, args, cmd))
|
||||
cmdutil.CheckErr(o.Run())
|
||||
},
|
||||
}
|
||||
|
||||
|
@ -106,8 +106,7 @@ func NewCmdCompletion(out io.Writer, boilerPlate string) *cobra.Command {
|
||||
Long: completionLong,
|
||||
Example: completionExample,
|
||||
Run: func(cmd *cobra.Command, args []string) {
|
||||
err := RunCompletion(out, boilerPlate, cmd, args)
|
||||
cmdutil.CheckErr(err)
|
||||
cmdutil.CheckErr(RunCompletion(out, boilerPlate, cmd, args))
|
||||
},
|
||||
ValidArgs: shells,
|
||||
}
|
||||
|
@ -260,8 +260,7 @@ func (o *CopyOptions) copyToPod(src, dest fileSpec, options *exec.ExecOptions) e
|
||||
|
||||
go func() {
|
||||
defer writer.Close()
|
||||
err := makeTar(src.File, dest.File, writer)
|
||||
cmdutil.CheckErr(err)
|
||||
cmdutil.CheckErr(makeTar(src.File, dest.File, writer))
|
||||
}()
|
||||
var cmdArr []string
|
||||
|
||||
@ -318,8 +317,7 @@ func (o *CopyOptions) copyFromPod(src, dest fileSpec) error {
|
||||
|
||||
go func() {
|
||||
defer outStream.Close()
|
||||
err := o.execute(options)
|
||||
cmdutil.CheckErr(err)
|
||||
cmdutil.CheckErr(o.execute(options))
|
||||
}()
|
||||
prefix := getPrefix(src.File)
|
||||
prefix = path.Clean(prefix)
|
||||
|
@ -120,8 +120,7 @@ func NewCmdWait(restClientGetter genericclioptions.RESTClientGetter, streams gen
|
||||
Run: func(cmd *cobra.Command, args []string) {
|
||||
o, err := flags.ToOptions(args)
|
||||
cmdutil.CheckErr(err)
|
||||
err = o.RunWait()
|
||||
cmdutil.CheckErr(err)
|
||||
cmdutil.CheckErr(o.RunWait())
|
||||
},
|
||||
SuggestFor: []string{"list", "ps"},
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user