Skip to content
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

consul/connect: Avoid assumption of parent service when filtering connect proxies #10872

Merged
merged 2 commits into from
Jul 8, 2021

Conversation

shoenig
Copy link
Member

@shoenig shoenig commented Jul 8, 2021

This PR uses regex-based matching for sidecar proxy services and checks when syncing
with Consul. Previously we would check if the parent of the sidecar was still being
tracked in Nomad. This is a false invariant - one which we must not depend when we
make #10845 work.

Fixes #10843

…nect proxies

This PR uses regex-based matching for sidecar proxy services and checks when syncing
with Consul. Previously we would check if the parent of the sidecar was still being
tracked in Nomad. This is a false invariant - one which we must not depend when we
make #10845 work.

Fixes #10843
@shoenig shoenig force-pushed the b-cc-regex-checkids branch from 28bbe8a to 86283ad Compare July 8, 2021 14:44
@vercel vercel bot temporarily deployed to Preview – nomad July 8, 2021 14:44 Inactive
@shoenig shoenig marked this pull request as ready for review July 8, 2021 15:36
@shoenig shoenig requested review from tgross and schmichael July 8, 2021 15:36
Copy link
Member

@tgross tgross left a comment

Choose a reason for hiding this comment

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

Overall idea here LGTM. I left a comment about the regex but I'll leave that to you to decide if that should be a blocker.

_, ok := services[id[:len(id)-len(sidecarSuffix)]]
return ok
var (
sidecarProxyCheckRe = regexp.MustCompile(`service:_nomad-.+-sidecar-proxy(:[\d]+)?`)
Copy link
Member

Choose a reason for hiding this comment

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

I'm not 100% sure how strict this has to be, but I was able to get this regex to match on some unexpected inputs. Maybe this should this have anchors at the start and end? Ex. https://play.golang.org/p/k8UFSZz3E6g

Copy link
Member Author

Choose a reason for hiding this comment

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

Good catch! Added regex and appended those test cases

@vercel vercel bot temporarily deployed to Preview – nomad July 8, 2021 18:05 Inactive
@shoenig shoenig merged commit 72f431f into main Jul 8, 2021
@shoenig shoenig deleted the b-cc-regex-checkids branch July 8, 2021 18:29
@notnoop notnoop mentioned this pull request Jul 28, 2021
@github-actions
Copy link

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.
If you have found a problem that seems related to this change, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Nov 18, 2022
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.

Connect sidecar and check management based on false invariant
2 participants