fix panic: kubectl rollout undo

pull/58/head
Pingan2017 2018-09-27 18:59:20 +08:00
parent d1111a57d9
commit 8593c02665
3 changed files with 6 additions and 31 deletions

View File

@ -81,16 +81,8 @@ func NewCmdRolloutPause(f cmdutil.Factory, streams genericclioptions.IOStreams)
Long: pause_long,
Example: pause_example,
Run: func(cmd *cobra.Command, args []string) {
allErrs := []error{}
err := o.Complete(f, cmd, args)
if err != nil {
allErrs = append(allErrs, err)
}
err = o.RunPause()
if err != nil {
allErrs = append(allErrs, err)
}
cmdutil.CheckErr(utilerrors.Flatten(utilerrors.NewAggregate(allErrs)))
cmdutil.CheckErr(o.Complete(f, cmd, args))
cmdutil.CheckErr(o.RunPause())
},
ValidArgs: validArgs,
}

View File

@ -84,16 +84,8 @@ func NewCmdRolloutResume(f cmdutil.Factory, streams genericclioptions.IOStreams)
Long: resume_long,
Example: resume_example,
Run: func(cmd *cobra.Command, args []string) {
allErrs := []error{}
err := o.Complete(f, cmd, args)
if err != nil {
allErrs = append(allErrs, err)
}
err = o.RunResume()
if err != nil {
allErrs = append(allErrs, err)
}
cmdutil.CheckErr(utilerrors.Flatten(utilerrors.NewAggregate(allErrs)))
cmdutil.CheckErr(o.Complete(f, cmd, args))
cmdutil.CheckErr(o.RunResume())
},
ValidArgs: validArgs,
}

View File

@ -20,7 +20,6 @@ import (
"github.com/spf13/cobra"
"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/printers"
"k8s.io/cli-runtime/pkg/genericclioptions/resource"
@ -84,16 +83,8 @@ func NewCmdRolloutUndo(f cmdutil.Factory, streams genericclioptions.IOStreams) *
Long: undo_long,
Example: undo_example,
Run: func(cmd *cobra.Command, args []string) {
allErrs := []error{}
err := o.Complete(f, cmd, args)
if err != nil {
allErrs = append(allErrs, err)
}
err = o.RunUndo()
if err != nil {
allErrs = append(allErrs, err)
}
cmdutil.CheckErr(utilerrors.Flatten(utilerrors.NewAggregate(allErrs)))
cmdutil.CheckErr(o.Complete(f, cmd, args))
cmdutil.CheckErr(o.RunUndo())
},
ValidArgs: validArgs,
}