### Apache Airflow version

2.2.5 (latest released)

### What happened

Helm installation fails with the following config:

``` 
postgresql:
  enabled: true
  nameOverride: overridename
```

The problem is manifested in the `-airflow-metadata` secret where the connection string will be generated without respect to the `nameOverride`

With the example config the generated string should be:

`postgresql://postgres:postgres@myrelease-overridename:5432/postgres?sslmode=disable`

but the actual string generated is:
`postgresql://postgres:postgres@myrelease-overridename.namespace:5432/postgres?sslmode=disable`




### What you think should happen instead

Installation should succeed with correctly generated metadata connection string

### How to reproduce

To reproduce just set the following in values.yaml and attempt `helm install`

``` 
postgresql:
  enabled: true
  nameOverride: overridename
```

### Operating System

Ubuntu

### Versions of Apache Airflow Providers

_No response_

### Deployment

Official Apache Airflow Helm Chart

### Deployment details

using helm with kind cluster

### Anything else

_No response_

### Are you willing to submit PR?

- [X] Yes I am willing to submit a PR!

### Code of Conduct

- [X] I agree to follow this project's [Code of Conduct](https://github.com/apache/airflow/blob/main/CODE_OF_CONDUCT.md)

#
#
from __future__ import annotations
import warnings
from subprocess import CalledProcessError
from typing import Any
from unittest import mock
import jmespath
import pytest
from tests.charts.helm_template_generator import render_chart
OBJECT_COUNT_IN_BASIC_DEPLOYMENT = 35
class TestBaseChartTest:
    def _get_values_with_version(self, values, version):
        if version != "default":
            values["airflowVersion"] = version
        return values
    def _get_object_count(self, version):
        if version == "2.3.2":
            return OBJECT_COUNT_IN_BASIC_DEPLOYMENT + 1
        return OBJECT_COUNT_IN_BASIC_DEPLOYMENT
    @pytest.mark.parametrize("version", ["2.3.2", "2.4.0", "default"])
    def test_basic_deployments(self, version):