-
Notifications
You must be signed in to change notification settings - Fork 321
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
Create mesh webhook to support v2 resources #2930
Conversation
843045b
to
8118bf8
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.
Wow, lots of great work @thisisnotashwin! My only dealbreaker was using the new consul-dataplane
arguments I linked to in the comments below.
One general question: Since much of this code is unchanged from the V1 Webhook, would there be less duplication if we kept everything in the same package and just had separate files/funcs for the V2 stuff? e.i. webhook.MeshWebhookV2()
vs webhookV2.MeshWebhook()
. We could also add this as a refactoring task after the code freeze.
control-plane/connect-inject/constants/annotations_and_labels.go
Outdated
Show resolved
Hide resolved
control-plane/connect-inject/webhook_v2/consul_dataplane_sidecar.go
Outdated
Show resolved
Hide resolved
control-plane/connect-inject/webhook_v2/consul_dataplane_sidecar.go
Outdated
Show resolved
Hide resolved
control-plane/connect-inject/webhook_v2/consul_dataplane_sidecar.go
Outdated
Show resolved
Hide resolved
422fa17
to
e2bbf16
Compare
e2bbf16
to
a5b0a1c
Compare
a5b0a1c
to
80fb3e0
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.
🎉 Looks great! Only one minor thing.
func (w *MeshWebhook) annotatedServiceNames(pod corev1.Pod) []string { | ||
var annotatedSvcNames []string | ||
if anno, ok := pod.Annotations[constants.AnnotationService]; ok { | ||
annotatedSvcNames = strings.Split(anno, ",") | ||
} | ||
return annotatedSvcNames | ||
} |
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.
Is this used anywhere now? I think we can deprecate it since we decouple the services.
80fb3e0
to
3b376d2
Compare
3b376d2
to
0a8bb71
Compare
Changes proposed in this PR:
How I've tested this PR:
How I expect reviewers to test this PR:
Checklist: