Skip to content
Closed
Show file tree
Hide file tree
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
29 changes: 16 additions & 13 deletions pkg/cmd/cli/cli.go
Original file line number Diff line number Diff line change
Expand Up @@ -62,30 +62,33 @@ func NewCommandCLI(name, fullName string) *cobra.Command {
in := os.Stdin
out := os.Stdout

cmds.AddCommand(cmd.NewCmdLogin(f, in, out))
// Kubernetes wrappers
cmds.AddCommand(cmd.NewCmdGet(fullName, f, out))
cmds.AddCommand(cmd.NewCmdUpdate(fullName, f, out))
cmds.AddCommand(cmd.NewCmdDelete(fullName, f, out))
cmds.AddCommand(cmd.NewCmdLog(fullName, f, out))
cmds.AddCommand(applyToCreate(cmd.NewCmdCreate(fullName, f, out))) // Deprecate 'osc apply' with 'osc create' command.
cmds.AddCommand(cmd.NewCmdExec(fullName, f, os.Stdin, out, os.Stderr))
cmds.AddCommand(cmd.NewCmdPortForward(fullName, f))
cmds.AddCommand(cmd.NewCmdDescribe(fullName, f, out))
cmds.AddCommand(cmd.NewCmdProxy(fullName, f, out))
cmds.AddCommand(cmd.NewCmdResize(fullName, f, out))

// OpenShift-specific commands
cmds.AddCommand(cmd.NewCmdProject(f, out))
cmds.AddCommand(cmd.NewCmdLogin(f, in, out))
cmds.AddCommand(cmd.NewCmdNewApplication(fullName, f, out))
cmds.AddCommand(cmd.NewCmdStatus(fullName, f, out))
cmds.AddCommand(cmd.NewCmdStartBuild(fullName, f, out))
cmds.AddCommand(cmd.NewCmdCancelBuild(fullName, f, out))
cmds.AddCommand(cmd.NewCmdBuildLogs(fullName, f, out))
cmds.AddCommand(cmd.NewCmdRollback(fullName, f, out))
cmds.AddCommand(cmd.NewCmdGet(fullName, f, out))
cmds.AddCommand(cmd.NewCmdDescribe(fullName, f, out))
// Deprecate 'osc apply' with 'osc create' command.
cmds.AddCommand(applyToCreate(cmd.NewCmdCreate(fullName, f, out)))
cmds.AddCommand(cmd.NewCmdProcess(fullName, f, out))
cmds.AddCommand(cmd.NewCmdUpdate(fullName, f, out))
cmds.AddCommand(cmd.NewCmdDelete(fullName, f, out))
cmds.AddCommand(cmd.NewCmdLog(fullName, f, out))
cmds.AddCommand(cmd.NewCmdExec(fullName, f, os.Stdin, out, os.Stderr))
cmds.AddCommand(cmd.NewCmdPortForward(fullName, f))
cmds.AddCommand(cmd.NewCmdProxy(fullName, f, out))
cmds.AddCommand(cmd.NewCmdConfig(fullName, "config"))
cmds.AddCommand(cmd.NewCmdOptions(f, out))
if name == fullName {
cmds.AddCommand(version.NewVersionCommand(fullName))
}
cmds.AddCommand(cmd.NewCmdConfig(fullName, "config"))
cmds.AddCommand(cmd.NewCmdOptions(f, out))

return cmds
}
Expand Down
21 changes: 21 additions & 0 deletions pkg/cmd/cli/cmd/wrappers.go
Original file line number Diff line number Diff line change
Expand Up @@ -197,3 +197,24 @@ Examples:
cmd.Long = fmt.Sprintf(longDesc, fullName)
return cmd
}

func NewCmdResize(fullName string, f *clientcmd.Factory, out io.Writer) *cobra.Command {
cmd := cmd.NewCmdResize(f.Factory, out)
longDesc := `Set a new size for a Replication Controller.

Resize also allows users to specify one or more preconditions for the resize action.
If --current-replicas or --resource-version is specified, it is validated before the
resize is attempted, and it is guaranteed that the precondition holds true when the
resize is sent to the server.

Examples:

# Resize replication controller named 'foo' to 3.
$ %[1]s resize --replicas=3 replicationcontrollers foo

# If the replication controller named foo's current size is 2, resize foo to 3.
$ %[1]s resize --current-replicas=2 --replicas=3 replicationcontrollers foo
`
cmd.Long = fmt.Sprintf(longDesc, fullName)
return cmd
}