Address comments.
This commit is contained in:
parent
155fb9f4be
commit
d1fa7ff7a8
@ -457,7 +457,7 @@ func TestResourceErrors(t *testing.T) {
|
|||||||
}{
|
}{
|
||||||
"no args": {
|
"no args": {
|
||||||
args: []string{},
|
args: []string{},
|
||||||
errFn: func(err error) bool { return strings.Contains(err.Error(), "you must provide one or more resources") },
|
errFn: func(err error) bool { return strings.Contains(err.Error(), "You must provide one or more resources") },
|
||||||
},
|
},
|
||||||
"resources but no selectors": {
|
"resources but no selectors": {
|
||||||
args: []string{"pods"},
|
args: []string{"pods"},
|
||||||
|
@ -49,7 +49,7 @@ var (
|
|||||||
)
|
)
|
||||||
|
|
||||||
const (
|
const (
|
||||||
execUsageStr = "expected 'exec <pod-name> <command> [arg1] [arg2] ... [argN]'.\n<pod-name> and <command> are required parameter for the exec command"
|
execUsageStr = "expected 'exec POD_NAME COMMAND [ARG1] [ARG2] ... [ARGN]'.\nPOD_NAME and COMMAND are required arguments for the exec command"
|
||||||
)
|
)
|
||||||
|
|
||||||
func NewCmdExec(f *cmdutil.Factory, cmdIn io.Reader, cmdOut, cmdErr io.Writer) *cobra.Command {
|
func NewCmdExec(f *cmdutil.Factory, cmdIn io.Reader, cmdOut, cmdErr io.Writer) *cobra.Command {
|
||||||
@ -142,7 +142,7 @@ func (p *ExecOptions) Complete(f *cmdutil.Factory, cmd *cobra.Command, argsIn []
|
|||||||
return cmdutil.UsageError(cmd, execUsageStr)
|
return cmdutil.UsageError(cmd, execUsageStr)
|
||||||
}
|
}
|
||||||
if len(p.PodName) != 0 {
|
if len(p.PodName) != 0 {
|
||||||
printDeprecationWarning("exec <pod-name>", "-p <pod-name>")
|
printDeprecationWarning("exec POD_NAME", "-p POD_NAME")
|
||||||
if len(argsIn) < 1 {
|
if len(argsIn) < 1 {
|
||||||
return cmdutil.UsageError(cmd, execUsageStr)
|
return cmdutil.UsageError(cmd, execUsageStr)
|
||||||
}
|
}
|
||||||
|
@ -54,7 +54,7 @@ var (
|
|||||||
)
|
)
|
||||||
|
|
||||||
const (
|
const (
|
||||||
logsUsageStr = "expected 'exec <pod-name> [container-name]'.\n<pod-name> is a required parameter for the logs command"
|
logsUsageStr = "expected 'logs POD_NAME [CONTAINER_NAME]'.\nPOD_NAME is a required argument for the logs command"
|
||||||
)
|
)
|
||||||
|
|
||||||
type LogsOptions struct {
|
type LogsOptions struct {
|
||||||
|
@ -124,7 +124,7 @@ func RunScale(f *cmdutil.Factory, out io.Writer, cmd *cobra.Command, args []stri
|
|||||||
|
|
||||||
count := cmdutil.GetFlagInt(cmd, "replicas")
|
count := cmdutil.GetFlagInt(cmd, "replicas")
|
||||||
if count < 0 {
|
if count < 0 {
|
||||||
return cmdutil.UsageError(cmd, "The --replicas=<count> flag is required, and <count> must be greater than or equal to 0")
|
return cmdutil.UsageError(cmd, "The --replicas=COUNT flag is required, and COUNT must be greater than or equal to 0")
|
||||||
}
|
}
|
||||||
|
|
||||||
infos := []*resource.Info{}
|
infos := []*resource.Info{}
|
||||||
|
Loading…
Reference in New Issue
Block a user