Skip to content
This repository has been archived by the owner on Sep 29, 2021. It is now read-only.

Adding global flag --strict-start to wildcard-based commands. #1269

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

hstefan
Copy link

@hstefan hstefan commented Apr 5, 2019

This forces job names to be matched from the string start. By default,
some commands will match on any jobs that contain the input name as a
substring, this option forces the match to only happen if the string
starts with the input name. Affects the subcommands: remove, inspect,
rolling-update, undeploy, deploy and stop.

The motivation behind this is production usages returning
"JOB_AMBIGUOUS_REFERENCE" in cases where a job's name is a substring of
another (eg: foo-bar and bar-foo-bar, as the first a substring of the
second).

Copy link
Member

@mattnworb mattnworb left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM overall. Could you add a test for the behavior in WildcardJobCommand?

@@ -95,6 +95,7 @@
private final List<Target> targets;
private final String username;
private boolean json;
private boolean strictStart;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

could you add strictStart to WildcardJobCommand instead of as a global flag for all commands in CliParser? It looks to me like it is only used and needed in WildcardJobCommand instances.

@hstefan hstefan force-pushed the helios-strict branch 3 times, most recently from 22ab3e1 to cf13def Compare April 9, 2019 11:04
This forces job names to be matched from the string start. By default,
some commands will match on any jobs that contain the input name as a
substring, this option forces the match to only happen if the string
starts with the input name. Affects the subcommands: remove, inspect,
rolling-update, undeploy, deploy and stop.

The motivation behind this is production usages returning
"JOB_AMBIGUOUS_REFERENCE" in cases where a job's name is a substring of
another (eg: foo-bar and bar-foo-bar, as the first a substring of the
second).
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants