Unverified Commit d4acd6b9 authored by Kubernetes Submit Queue's avatar Kubernetes Submit Queue Committed by GitHub

Merge pull request #58283 from nikhita/kubectl-scale-unstructured

Automatic merge from submit-queue (batch tested with PRs 59463, 59719, 60181, 58283, 59966). If you want to cherry-pick this change to another branch, please follow the instructions <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md">here</a>. kubectl scale: support Unstructured objects Support `Unstructured` objects with kubectl scale. So that we can use the scale subresource for custom resources (possible after https://github.com/kubernetes/kubernetes/pull/55168 is merged): ``` ➜ cluster/kubectl.sh scale --replicas=5 crontabs/my-new-cron-object crontab "my-new-cron-object" scaled ``` **Release note**: ```release-note NONE ``` /cc sttts deads2k p0lyn0mial
parents fe0e80e8 5cdd4dcb
...@@ -110,7 +110,7 @@ func RunScale(f cmdutil.Factory, out, errOut io.Writer, cmd *cobra.Command, args ...@@ -110,7 +110,7 @@ func RunScale(f cmdutil.Factory, out, errOut io.Writer, cmd *cobra.Command, args
all := cmdutil.GetFlagBool(cmd, "all") all := cmdutil.GetFlagBool(cmd, "all")
r := f.NewBuilder(). r := f.NewBuilder().
Internal(). Unstructured().
ContinueOnError(). ContinueOnError().
NamespaceParam(cmdNamespace).DefaultNamespace(). NamespaceParam(cmdNamespace).DefaultNamespace().
FilenameParam(enforceNamespace, options). FilenameParam(enforceNamespace, options).
...@@ -173,7 +173,7 @@ func RunScale(f cmdutil.Factory, out, errOut io.Writer, cmd *cobra.Command, args ...@@ -173,7 +173,7 @@ func RunScale(f cmdutil.Factory, out, errOut io.Writer, cmd *cobra.Command, args
return err return err
} }
mapping := info.ResourceMapping() mapping := info.ResourceMapping()
client, err := f.ClientForMapping(mapping) client, err := f.UnstructuredClientForMapping(mapping)
if err != nil { if err != nil {
return err return err
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment