Skip to content

[BUG] Fix scale and autoscale oc completion #1994

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions pkg/cli/kubectlwrappers/wrappers.go
Original file line number Diff line number Diff line change
Expand Up @@ -143,15 +143,17 @@ func NewCmdProxy(f kcmdutil.Factory, streams genericiooptions.IOStreams) *cobra.
// NewCmdScale is a wrapper for the Kubernetes cli scale command
func NewCmdScale(f kcmdutil.Factory, streams genericiooptions.IOStreams) *cobra.Command {
cmd := cmdutil.ReplaceCommandName("kubectl", "oc", templates.Normalize(scale.NewCmdScale(f, streams)))
cmd.ValidArgs = append(cmd.ValidArgs, "deploymentconfig")
validArgs := []string{"deployment", "replicaset", "replicationcontroller", "statefulset", "deploymentconfig"}
cmd.ValidArgsFunction = utilcomp.SpecifiedResourceTypeAndNameCompletionFunc(f, validArgs)
return cmd
}

// NewCmdAutoscale is a wrapper for the Kubernetes cli autoscale command
func NewCmdAutoscale(f kcmdutil.Factory, streams genericiooptions.IOStreams) *cobra.Command {
cmd := cmdutil.ReplaceCommandName("kubectl", "oc", templates.Normalize(autoscale.NewCmdAutoscale(f, streams)))
cmd.Short = "Autoscale a deployment config, deployment, replica set, stateful set, or replication controller"
cmd.ValidArgs = append(cmd.ValidArgs, "deploymentconfig")
validArgs := []string{"deployment", "replicaset", "replicationcontroller", "statefulset", "deploymentconfig"}
cmd.ValidArgsFunction = utilcomp.SpecifiedResourceTypeAndNameCompletionFunc(f, validArgs)
return cmd
}

Expand Down