mirror of https://github.com/k3s-io/k3s
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 p0lyn0mialpull/6/head
commit
d4acd6b997
|
@ -110,7 +110,7 @@ func RunScale(f cmdutil.Factory, out, errOut io.Writer, cmd *cobra.Command, args
|
|||
all := cmdutil.GetFlagBool(cmd, "all")
|
||||
|
||||
r := f.NewBuilder().
|
||||
Internal().
|
||||
Unstructured().
|
||||
ContinueOnError().
|
||||
NamespaceParam(cmdNamespace).DefaultNamespace().
|
||||
FilenameParam(enforceNamespace, options).
|
||||
|
@ -173,7 +173,7 @@ func RunScale(f cmdutil.Factory, out, errOut io.Writer, cmd *cobra.Command, args
|
|||
return err
|
||||
}
|
||||
mapping := info.ResourceMapping()
|
||||
client, err := f.ClientForMapping(mapping)
|
||||
client, err := f.UnstructuredClientForMapping(mapping)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue