-
Notifications
You must be signed in to change notification settings - Fork 151
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
d/workspace_ids: Require exact match when no wildcard #752
d/workspace_ids: Require exact match when no wildcard #752
Conversation
6dcf862
to
bb4f587
Compare
@@ -56,7 +56,7 @@ func includedByName(names map[string]bool, workspaceName string) bool { | |||
case len(name) == 0: | |||
continue | |||
case !strings.HasPrefix(name, "*") && !strings.HasSuffix(name, "*"): | |||
if strings.Contains(workspaceName, name) { | |||
if name == workspaceName { |
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.
👍 Nice catch. Wondering how the behavior of strings.Contains(workspaceName, name)
creates a bug, since they both perform a string comparison?
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.
It's because Contains
doesn't match the whole string -- strings.Contains("partial", "art")
will return true, but "partial" == "art"
is false.
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.
This looks good. ✅ However! You've got the wrong jira issue number in your branch name, so something unrelated ended up in the review column on our board. 😆
👍 thanks @nfagerlund. |
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.
✅
Description
There was a bug in the new d/tfe_workspace_ids wildcard logic that performed a substring match even when no wildcards were present
External links
Closes #747
Output from acceptance tests