mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-08-02 00:07:50 +00:00
fix panic: kubectl rollout undo
This commit is contained in:
parent
d1111a57d9
commit
8593c02665
@ -81,16 +81,8 @@ func NewCmdRolloutPause(f cmdutil.Factory, streams genericclioptions.IOStreams)
|
|||||||
Long: pause_long,
|
Long: pause_long,
|
||||||
Example: pause_example,
|
Example: pause_example,
|
||||||
Run: func(cmd *cobra.Command, args []string) {
|
Run: func(cmd *cobra.Command, args []string) {
|
||||||
allErrs := []error{}
|
cmdutil.CheckErr(o.Complete(f, cmd, args))
|
||||||
err := o.Complete(f, cmd, args)
|
cmdutil.CheckErr(o.RunPause())
|
||||||
if err != nil {
|
|
||||||
allErrs = append(allErrs, err)
|
|
||||||
}
|
|
||||||
err = o.RunPause()
|
|
||||||
if err != nil {
|
|
||||||
allErrs = append(allErrs, err)
|
|
||||||
}
|
|
||||||
cmdutil.CheckErr(utilerrors.Flatten(utilerrors.NewAggregate(allErrs)))
|
|
||||||
},
|
},
|
||||||
ValidArgs: validArgs,
|
ValidArgs: validArgs,
|
||||||
}
|
}
|
||||||
|
@ -84,16 +84,8 @@ func NewCmdRolloutResume(f cmdutil.Factory, streams genericclioptions.IOStreams)
|
|||||||
Long: resume_long,
|
Long: resume_long,
|
||||||
Example: resume_example,
|
Example: resume_example,
|
||||||
Run: func(cmd *cobra.Command, args []string) {
|
Run: func(cmd *cobra.Command, args []string) {
|
||||||
allErrs := []error{}
|
cmdutil.CheckErr(o.Complete(f, cmd, args))
|
||||||
err := o.Complete(f, cmd, args)
|
cmdutil.CheckErr(o.RunResume())
|
||||||
if err != nil {
|
|
||||||
allErrs = append(allErrs, err)
|
|
||||||
}
|
|
||||||
err = o.RunResume()
|
|
||||||
if err != nil {
|
|
||||||
allErrs = append(allErrs, err)
|
|
||||||
}
|
|
||||||
cmdutil.CheckErr(utilerrors.Flatten(utilerrors.NewAggregate(allErrs)))
|
|
||||||
},
|
},
|
||||||
ValidArgs: validArgs,
|
ValidArgs: validArgs,
|
||||||
}
|
}
|
||||||
|
@ -20,7 +20,6 @@ import (
|
|||||||
"github.com/spf13/cobra"
|
"github.com/spf13/cobra"
|
||||||
"k8s.io/kubernetes/pkg/kubectl/polymorphichelpers"
|
"k8s.io/kubernetes/pkg/kubectl/polymorphichelpers"
|
||||||
|
|
||||||
utilerrors "k8s.io/apimachinery/pkg/util/errors"
|
|
||||||
"k8s.io/cli-runtime/pkg/genericclioptions"
|
"k8s.io/cli-runtime/pkg/genericclioptions"
|
||||||
"k8s.io/cli-runtime/pkg/genericclioptions/printers"
|
"k8s.io/cli-runtime/pkg/genericclioptions/printers"
|
||||||
"k8s.io/cli-runtime/pkg/genericclioptions/resource"
|
"k8s.io/cli-runtime/pkg/genericclioptions/resource"
|
||||||
@ -84,16 +83,8 @@ func NewCmdRolloutUndo(f cmdutil.Factory, streams genericclioptions.IOStreams) *
|
|||||||
Long: undo_long,
|
Long: undo_long,
|
||||||
Example: undo_example,
|
Example: undo_example,
|
||||||
Run: func(cmd *cobra.Command, args []string) {
|
Run: func(cmd *cobra.Command, args []string) {
|
||||||
allErrs := []error{}
|
cmdutil.CheckErr(o.Complete(f, cmd, args))
|
||||||
err := o.Complete(f, cmd, args)
|
cmdutil.CheckErr(o.RunUndo())
|
||||||
if err != nil {
|
|
||||||
allErrs = append(allErrs, err)
|
|
||||||
}
|
|
||||||
err = o.RunUndo()
|
|
||||||
if err != nil {
|
|
||||||
allErrs = append(allErrs, err)
|
|
||||||
}
|
|
||||||
cmdutil.CheckErr(utilerrors.Flatten(utilerrors.NewAggregate(allErrs)))
|
|
||||||
},
|
},
|
||||||
ValidArgs: validArgs,
|
ValidArgs: validArgs,
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user