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

Create mesh webhook to support v2 resources #2930

Merged
merged 2 commits into from
Sep 12, 2023

Conversation

thisisnotashwin
Copy link
Contributor

Changes proposed in this PR:

  • Created a copy of the mesh webhook folder and made updates required to support v2

How I've tested this PR:

  • unit tests

How I expect reviewers to test this PR:

  • 👀

Checklist:

@thisisnotashwin thisisnotashwin added pr/no-changelog PR does not need a corresponding .changelog entry pr/no-backport signals that a PR will not contain a backport label labels Sep 8, 2023
@thisisnotashwin thisisnotashwin force-pushed the ashwin/NET-5320-mesh-webhook-v2 branch 4 times, most recently from 843045b to 8118bf8 Compare September 8, 2023 15:16
Copy link
Contributor

@DanStough DanStough left a 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.

Copy link
Contributor

@DanStough DanStough left a 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.

Comment on lines 561 to 567
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
}
Copy link
Contributor

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.

@thisisnotashwin thisisnotashwin merged commit c73605e into main Sep 12, 2023
3 checks passed
@thisisnotashwin thisisnotashwin deleted the ashwin/NET-5320-mesh-webhook-v2 branch September 12, 2023 16:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
pr/no-backport signals that a PR will not contain a backport label pr/no-changelog PR does not need a corresponding .changelog entry
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants