-
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
consul/connect: Avoid assumption of parent service when filtering connect proxies #10872
Conversation
ad07526
to
28bbe8a
Compare
28bbe8a
to
86283ad
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.
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]+)?`) |
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.
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
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.
Good catch! Added regex and appended those test cases
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. |
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