Merge pull request #99892 from changshuchao/last-applied
code cleanup for kubectl apply_edit_last_applied.go ,completion.go,cp.go,wait.go Kubernetes-commit: 87e7f749a88913396c02e3e7d10253e516f04199
This commit is contained in:
commit
76fce851e0
|
|
@ -1032,23 +1032,23 @@
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"ImportPath": "k8s.io/api",
|
"ImportPath": "k8s.io/api",
|
||||||
"Rev": "3a2d6b5bb7f8"
|
"Rev": "e32abb16c84d"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"ImportPath": "k8s.io/apimachinery",
|
"ImportPath": "k8s.io/apimachinery",
|
||||||
"Rev": "57f2a0733447"
|
"Rev": "74cf9d365d5e"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"ImportPath": "k8s.io/cli-runtime",
|
"ImportPath": "k8s.io/cli-runtime",
|
||||||
"Rev": "2ae662a69743"
|
"Rev": "c2f4736118ac"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"ImportPath": "k8s.io/client-go",
|
"ImportPath": "k8s.io/client-go",
|
||||||
"Rev": "f6ce18ae578c"
|
"Rev": "4841142cdc4b"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"ImportPath": "k8s.io/code-generator",
|
"ImportPath": "k8s.io/code-generator",
|
||||||
"Rev": "5bc604e30f37"
|
"Rev": "3112572d2fa0"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"ImportPath": "k8s.io/component-base",
|
"ImportPath": "k8s.io/component-base",
|
||||||
|
|
|
||||||
18
go.mod
18
go.mod
|
|
@ -33,10 +33,10 @@ require (
|
||||||
github.com/stretchr/testify v1.6.1
|
github.com/stretchr/testify v1.6.1
|
||||||
golang.org/x/sys v0.0.0-20210225134936-a50acf3fe073
|
golang.org/x/sys v0.0.0-20210225134936-a50acf3fe073
|
||||||
gopkg.in/yaml.v2 v2.4.0
|
gopkg.in/yaml.v2 v2.4.0
|
||||||
k8s.io/api v0.0.0-20210323190948-3a2d6b5bb7f8
|
k8s.io/api v0.0.0-20210408231833-e32abb16c84d
|
||||||
k8s.io/apimachinery v0.0.0-20210313025227-57f2a0733447
|
k8s.io/apimachinery v0.0.0-20210408225951-74cf9d365d5e
|
||||||
k8s.io/cli-runtime v0.0.0-20210313035200-2ae662a69743
|
k8s.io/cli-runtime v0.0.0-20210324233727-c2f4736118ac
|
||||||
k8s.io/client-go v0.0.0-20210313030403-f6ce18ae578c
|
k8s.io/client-go v0.0.0-20210408232125-4841142cdc4b
|
||||||
k8s.io/component-base v0.0.0-20210324071744-e913a9709153
|
k8s.io/component-base v0.0.0-20210324071744-e913a9709153
|
||||||
k8s.io/component-helpers v0.0.0-20210313031811-38d994307f22
|
k8s.io/component-helpers v0.0.0-20210313031811-38d994307f22
|
||||||
k8s.io/klog/v2 v2.8.0
|
k8s.io/klog/v2 v2.8.0
|
||||||
|
|
@ -49,11 +49,11 @@ require (
|
||||||
)
|
)
|
||||||
|
|
||||||
replace (
|
replace (
|
||||||
k8s.io/api => k8s.io/api v0.0.0-20210323190948-3a2d6b5bb7f8
|
k8s.io/api => k8s.io/api v0.0.0-20210408231833-e32abb16c84d
|
||||||
k8s.io/apimachinery => k8s.io/apimachinery v0.0.0-20210313025227-57f2a0733447
|
k8s.io/apimachinery => k8s.io/apimachinery v0.0.0-20210408225951-74cf9d365d5e
|
||||||
k8s.io/cli-runtime => k8s.io/cli-runtime v0.0.0-20210313035200-2ae662a69743
|
k8s.io/cli-runtime => k8s.io/cli-runtime v0.0.0-20210324233727-c2f4736118ac
|
||||||
k8s.io/client-go => k8s.io/client-go v0.0.0-20210313030403-f6ce18ae578c
|
k8s.io/client-go => k8s.io/client-go v0.0.0-20210408232125-4841142cdc4b
|
||||||
k8s.io/code-generator => k8s.io/code-generator v0.0.0-20210313024825-5bc604e30f37
|
k8s.io/code-generator => k8s.io/code-generator v0.0.0-20210408230000-3112572d2fa0
|
||||||
k8s.io/component-base => k8s.io/component-base v0.0.0-20210324071744-e913a9709153
|
k8s.io/component-base => k8s.io/component-base v0.0.0-20210324071744-e913a9709153
|
||||||
k8s.io/component-helpers => k8s.io/component-helpers v0.0.0-20210313031811-38d994307f22
|
k8s.io/component-helpers => k8s.io/component-helpers v0.0.0-20210313031811-38d994307f22
|
||||||
k8s.io/metrics => k8s.io/metrics v0.0.0-20210313034850-5ca43742ab93
|
k8s.io/metrics => k8s.io/metrics v0.0.0-20210313034850-5ca43742ab93
|
||||||
|
|
|
||||||
10
go.sum
10
go.sum
|
|
@ -721,11 +721,11 @@ honnef.co/go/tools v0.0.0-20190418001031-e561f6794a2a/go.mod h1:rf3lG4BRIbNafJWh
|
||||||
honnef.co/go/tools v0.0.0-20190523083050-ea95bdfd59fc/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4=
|
honnef.co/go/tools v0.0.0-20190523083050-ea95bdfd59fc/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4=
|
||||||
honnef.co/go/tools v0.0.1-2019.2.3/go.mod h1:a3bituU0lyd329TUQxRnasdCoJDkEUEAqEt0JzvZhAg=
|
honnef.co/go/tools v0.0.1-2019.2.3/go.mod h1:a3bituU0lyd329TUQxRnasdCoJDkEUEAqEt0JzvZhAg=
|
||||||
honnef.co/go/tools v0.0.1-2020.1.3/go.mod h1:X/FiERA/W4tHapMX5mGpAtMSVEeEUOyHaw9vFzvIQ3k=
|
honnef.co/go/tools v0.0.1-2020.1.3/go.mod h1:X/FiERA/W4tHapMX5mGpAtMSVEeEUOyHaw9vFzvIQ3k=
|
||||||
k8s.io/api v0.0.0-20210323190948-3a2d6b5bb7f8/go.mod h1:7Byi1J8zhqxObDDyvyvJdvEZioXQZDTsNqSFMk4JMMM=
|
k8s.io/api v0.0.0-20210408231833-e32abb16c84d/go.mod h1:qWBQaP6/XkVq3wtewQmaEEUxdGD1f/HstASE9fJtjns=
|
||||||
k8s.io/apimachinery v0.0.0-20210313025227-57f2a0733447/go.mod h1:jbreFvJo3ov9rj7eWT7+sYiRx+qZuCYXwWT1bcDswPY=
|
k8s.io/apimachinery v0.0.0-20210408225951-74cf9d365d5e/go.mod h1:jbreFvJo3ov9rj7eWT7+sYiRx+qZuCYXwWT1bcDswPY=
|
||||||
k8s.io/cli-runtime v0.0.0-20210313035200-2ae662a69743/go.mod h1:NVamgG91qHBicZ0gB6NPRqMqFqaBiGmzAJu/CF33/Ag=
|
k8s.io/cli-runtime v0.0.0-20210324233727-c2f4736118ac/go.mod h1:Ulb9RafJ//G4NCfGurCaocWo9XVj+KrbRnJ9Ryc0COI=
|
||||||
k8s.io/client-go v0.0.0-20210313030403-f6ce18ae578c/go.mod h1:4u6PvPJOUogAjcm6A0yv7SXKhoR4NQafsc4RuKbouZk=
|
k8s.io/client-go v0.0.0-20210408232125-4841142cdc4b/go.mod h1:vrSe4BaYXu8a9KjSA3kIlQSuwWshJLlMzgEiqg+69zQ=
|
||||||
k8s.io/code-generator v0.0.0-20210313024825-5bc604e30f37/go.mod h1:hUlps5+9QaTrKx+jiM4rmq7YmH8wPOIko64uZCHDh6Q=
|
k8s.io/code-generator v0.0.0-20210408230000-3112572d2fa0/go.mod h1:hUlps5+9QaTrKx+jiM4rmq7YmH8wPOIko64uZCHDh6Q=
|
||||||
k8s.io/component-base v0.0.0-20210324071744-e913a9709153/go.mod h1:9MPVmiPTmiZvJVCLRxzzagwGC6u7pOXNi7xM+3cwghk=
|
k8s.io/component-base v0.0.0-20210324071744-e913a9709153/go.mod h1:9MPVmiPTmiZvJVCLRxzzagwGC6u7pOXNi7xM+3cwghk=
|
||||||
k8s.io/component-helpers v0.0.0-20210313031811-38d994307f22/go.mod h1:6cBGPXFQcY4ftKGLKTHHouDmx3shHM0CGYvxMTggJ6Q=
|
k8s.io/component-helpers v0.0.0-20210313031811-38d994307f22/go.mod h1:6cBGPXFQcY4ftKGLKTHHouDmx3shHM0CGYvxMTggJ6Q=
|
||||||
k8s.io/gengo v0.0.0-20200413195148-3a45101e95ac/go.mod h1:ezvh/TsK7cY6rbqRK0oQQ8IAqLxYwwyPxAX1Pzy0ii0=
|
k8s.io/gengo v0.0.0-20200413195148-3a45101e95ac/go.mod h1:ezvh/TsK7cY6rbqRK0oQQ8IAqLxYwwyPxAX1Pzy0ii0=
|
||||||
|
|
|
||||||
|
|
@ -67,12 +67,8 @@ func NewCmdApplyEditLastApplied(f cmdutil.Factory, ioStreams genericclioptions.I
|
||||||
Long: applyEditLastAppliedLong,
|
Long: applyEditLastAppliedLong,
|
||||||
Example: applyEditLastAppliedExample,
|
Example: applyEditLastAppliedExample,
|
||||||
Run: func(cmd *cobra.Command, args []string) {
|
Run: func(cmd *cobra.Command, args []string) {
|
||||||
if err := o.Complete(f, args, cmd); err != nil {
|
cmdutil.CheckErr(o.Complete(f, args, cmd))
|
||||||
cmdutil.CheckErr(err)
|
cmdutil.CheckErr(o.Run())
|
||||||
}
|
|
||||||
if err := o.Run(); err != nil {
|
|
||||||
cmdutil.CheckErr(err)
|
|
||||||
}
|
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -106,8 +106,7 @@ func NewCmdCompletion(out io.Writer, boilerPlate string) *cobra.Command {
|
||||||
Long: completionLong,
|
Long: completionLong,
|
||||||
Example: completionExample,
|
Example: completionExample,
|
||||||
Run: func(cmd *cobra.Command, args []string) {
|
Run: func(cmd *cobra.Command, args []string) {
|
||||||
err := RunCompletion(out, boilerPlate, cmd, args)
|
cmdutil.CheckErr(RunCompletion(out, boilerPlate, cmd, args))
|
||||||
cmdutil.CheckErr(err)
|
|
||||||
},
|
},
|
||||||
ValidArgs: shells,
|
ValidArgs: shells,
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -260,8 +260,7 @@ func (o *CopyOptions) copyToPod(src, dest fileSpec, options *exec.ExecOptions) e
|
||||||
|
|
||||||
go func() {
|
go func() {
|
||||||
defer writer.Close()
|
defer writer.Close()
|
||||||
err := makeTar(src.File, dest.File, writer)
|
cmdutil.CheckErr(makeTar(src.File, dest.File, writer))
|
||||||
cmdutil.CheckErr(err)
|
|
||||||
}()
|
}()
|
||||||
var cmdArr []string
|
var cmdArr []string
|
||||||
|
|
||||||
|
|
@ -318,8 +317,7 @@ func (o *CopyOptions) copyFromPod(src, dest fileSpec) error {
|
||||||
|
|
||||||
go func() {
|
go func() {
|
||||||
defer outStream.Close()
|
defer outStream.Close()
|
||||||
err := o.execute(options)
|
cmdutil.CheckErr(o.execute(options))
|
||||||
cmdutil.CheckErr(err)
|
|
||||||
}()
|
}()
|
||||||
prefix := getPrefix(src.File)
|
prefix := getPrefix(src.File)
|
||||||
prefix = path.Clean(prefix)
|
prefix = path.Clean(prefix)
|
||||||
|
|
|
||||||
|
|
@ -120,8 +120,7 @@ func NewCmdWait(restClientGetter genericclioptions.RESTClientGetter, streams gen
|
||||||
Run: func(cmd *cobra.Command, args []string) {
|
Run: func(cmd *cobra.Command, args []string) {
|
||||||
o, err := flags.ToOptions(args)
|
o, err := flags.ToOptions(args)
|
||||||
cmdutil.CheckErr(err)
|
cmdutil.CheckErr(err)
|
||||||
err = o.RunWait()
|
cmdutil.CheckErr(o.RunWait())
|
||||||
cmdutil.CheckErr(err)
|
|
||||||
},
|
},
|
||||||
SuggestFor: []string{"list", "ps"},
|
SuggestFor: []string{"list", "ps"},
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue