resize: Enable resource type/name syntax

Also don't allow more than one objects in commands it makes sense
This commit is contained in:
kargakis 2015-05-21 15:05:34 +02:00
parent d3778f5f5a
commit 6424a2bc63
2 changed files with 7 additions and 1 deletions

View File

@ -86,6 +86,9 @@ func RunDescribe(f *cmdutil.Factory, out io.Writer, cmd *cobra.Command, args []s
}
return err
}
if len(infos) > 1 {
return fmt.Errorf("multiple resources provided: %v", args)
}
info := infos[0]
s, err := describer.Describe(info.Namespace, info.Name)

View File

@ -65,7 +65,7 @@ func NewCmdResize(f *cmdutil.Factory, out io.Writer) *cobra.Command {
func RunResize(f *cmdutil.Factory, out io.Writer, cmd *cobra.Command, args []string) error {
count := cmdutil.GetFlagInt(cmd, "replicas")
if len(args) != 2 || count < 0 {
if count < 0 {
return cmdutil.UsageError(cmd, "--replicas=COUNT RESOURCE ID")
}
@ -94,6 +94,9 @@ func RunResize(f *cmdutil.Factory, out io.Writer, cmd *cobra.Command, args []str
if err != nil {
return err
}
if len(infos) > 1 {
return fmt.Errorf("multiple resources provided: %v", args)
}
info := infos[0]
resizer, err := f.Resizer(mapping)