-
Notifications
You must be signed in to change notification settings - Fork 2k
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
cli: improve wildcard namespace prefix matches #10648
Conversation
When a wildcard namespace is used for `nomad job` commands that support prefix matching, avoid asking the user for input if a prefix is an unambiguous exact match so that the behavior is similar to the commands using a specific or unset namespace.
e03586b
to
dd24cf9
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
command/job_deployments.go
Outdated
c.Ui.Error(fmt.Sprintf("Prefix matched multiple jobs\n\n%s", createStatusListOutput(jobs, c.allNamespaces()))) | ||
return 1 | ||
if len(jobs) > 1 { | ||
if strings.TrimSpace(jobID) != jobs[0].ID { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: couldn't we move the TrimSpace up above, i.e. jobID := strings.TrimSpace(args[0])
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Alternately, we could remove it and punish anyone who intentionally does nomad job status " example "
😀
Will fix!
I'm going to lock this pull request because it has been closed for 120 days ⏳. This helps our maintainers find and focus on the active contributions. |
Fixes #10625
When a wildcard namespace is used for
nomad job
commands that support prefixmatching, avoid asking the user for input if a prefix is an unambiguous exact
match so that the behavior is similar to the commands using a specific or
unset namespace.