linkerd / linkerd2

Ultralight, security-first service mesh for Kubernetes. Main repo for Linkerd 2.x.
https://linkerd.io
Apache License 2.0
10.48k stars 1.27k forks source link

add nil check when reading endpoint hostname #12689

Closed adleong closed 3 weeks ago

adleong commented 3 weeks ago

Fixes #12686

When an endpoint in an EndpointSlice resource does not contain a hostname field, the destination controller can panic while looking for an endpoint with a certain hostname. This happens when doing a lookup with a pod dns name.

We add a nil check to avoid the panic.

We add such an endpoint to our test fixture to exercise this case.

acallejaszu commented 3 weeks ago

Thanks for the quick response on this! It would be nice to see a mention as this is the fix I proposed in the issue, but :man-shrugging:

adleong commented 3 weeks ago

@acallejaszu Yes, absolutely! Thank you so much for finding, root causing, and solving this bug. I do want to make sure that you're properly credited. What did you have in mind?

acallejaszu commented 3 weeks ago

Hey @adleong thanks for your response! Just a mention in the release description/changelog where you will include this bug fix will be more than enough. Thanks!