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:
We use an "empty label" trailing dot for our internal domains:
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.
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:
https://github.com/redpanda-data/helm-charts/blob/aca43d8bd857e9d41e68269765fa84f68774203e/charts/redpanda/helpers.go#L136
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.