redpanda-data / helm-charts

Redpanda Helm Chart
http://redpanda.com
Apache License 2.0
77 stars 96 forks source link

Support trailing empty labels in FQDN parsing routine #1493

Closed andrewstucki closed 2 months ago

andrewstucki commented 2 months ago

Previously addressing feedback in my PR to introduce a Kafka/Admin API client constructor into this repo, I refactored the URL construction code to leverage the same internal helper that constructs URLs with the InternalDomain helper.

Doing this exposed two things:

  1. We use an "empty label" trailing dot for our internal domains:

https://github.com/redpanda-data/helm-charts/blob/aca43d8bd857e9d41e68269765fa84f68774203e/charts/redpanda/helpers.go#L136

  1. We weren't handling that in the FQDN parsing code that I had added for our dialer.

As a result, when I tried to tie these two pieces of code together with the introduction of a client factory in our operator repo, anything using a Redpanda cluster reference to initialize a client failed with an "invalid FQDN" error. This fixes that and supports the perfectly valid use-case where we have an empty label terminating a fully qualified domain name.