mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-09-04 10:47:25 +00:00
Merge pull request #8618 from kargakis/resize-enable-slash-syntax
resize: Enable resource type/name syntax
This commit is contained in:
@@ -86,6 +86,9 @@ func RunDescribe(f *cmdutil.Factory, out io.Writer, cmd *cobra.Command, args []s
|
|||||||
}
|
}
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
if len(infos) > 1 {
|
||||||
|
return fmt.Errorf("multiple resources provided: %v", args)
|
||||||
|
}
|
||||||
info := infos[0]
|
info := infos[0]
|
||||||
|
|
||||||
s, err := describer.Describe(info.Namespace, info.Name)
|
s, err := describer.Describe(info.Namespace, info.Name)
|
||||||
|
@@ -61,7 +61,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 {
|
func RunResize(f *cmdutil.Factory, out io.Writer, cmd *cobra.Command, args []string) error {
|
||||||
count := cmdutil.GetFlagInt(cmd, "replicas")
|
count := cmdutil.GetFlagInt(cmd, "replicas")
|
||||||
if len(args) != 2 || count < 0 {
|
if count < 0 {
|
||||||
return cmdutil.UsageError(cmd, "--replicas=COUNT RESOURCE ID")
|
return cmdutil.UsageError(cmd, "--replicas=COUNT RESOURCE ID")
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -90,6 +90,9 @@ func RunResize(f *cmdutil.Factory, out io.Writer, cmd *cobra.Command, args []str
|
|||||||
if err != nil {
|
if err != nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
if len(infos) > 1 {
|
||||||
|
return fmt.Errorf("multiple resources provided: %v", args)
|
||||||
|
}
|
||||||
info := infos[0]
|
info := infos[0]
|
||||||
|
|
||||||
resizer, err := f.Resizer(mapping)
|
resizer, err := f.Resizer(mapping)
|
||||||
|
Reference in New Issue
Block a user