fix: Render the release-prefixed host in the LabKit Secret

What does this MR do and why?

The LabKit-format PostgreSQL Secret built its host from $cluster.name, while the CloudNativePG Cluster, the read-write Service it creates, and the -conn Secret beside it all use the release-prefixed $clusterName. With any non-empty release name, the Secret handed to LabKit named a Service that does not exist.

Rendering host from $clusterName lines it up with everything else the chart creates for that cluster.

The block was added in 1c192b5a after the release prefix landed in 0e8d4bdc, so it simply did not pick up the surrounding pattern.

Differences

Before: with a release named test, the same file rendered PGHOST: test-gitlab-rw.default.svc in the -conn Secret and host: gitlab-rw.default.svc in the LabKit Secret, while the Cluster rendered as test-gitlab. CloudNativePG creates the Service test-gitlab-rw, so the LabKit consumer was pointed at a host that resolves to nothing.

After: both render test-gitlab-rw.default.svc, matching the Cluster and its Service. The second cluster in the example values behaves the same way, rendering test-registry-rw.default.svc.

How to set up and validate locally

helm dependency update .
helm template test . | grep -E '^\s+(host|PGHOST):'

Every line reports the release-prefixed host. On main, the host entries drop the prefix while the PGHOST entries keep it.

helm lint . passes.

Edited by Jeston Singh

Merge request reports

Loading
Loading