### 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)

(f"{release_name}-worker", "StatefulSet", "worker"),
            (f"{release_name}-worker-policy", "NetworkPolicy", "airflow-worker-policy"),
            (f"{release_name}-triggerer", "Deployment", "triggerer"),
            (f"{release_name}-dag-processor", "Deployment", "dag-processor"),
            (f"{release_name}-logs", "PersistentVolumeClaim", "logs-pvc"),
            (f"{release_name}-dags", "PersistentVolumeClaim", "dags-pvc"),
        ]
        for k8s_object_name, kind, component in kind_names_tuples:
            expected_labels = {
                "label1": "value1",
                "label2": "value2",
                "tier": "airflow",
                "release": release_name,
                "heritage": "Helm",
                "chart": mock.ANY,
            }
            if component:
                expected_labels["component"] = component
            if k8s_object_name == f"{release_name}-scheduler":
                expected_labels["executor"] = "CeleryExecutor"
            actual_labels = kind_k8s_obj_labels_tuples.pop((k8s_object_name, kind))
            assert actual_labels == expected_labels
        if kind_k8s_obj_labels_tuples:
            warnings.warn(f"Unchecked objects: {kind_k8s_obj_labels_tuples.keys()}")
    def test_labels_are_valid_on_job_templates(self):
        """Test labels are correctly applied on all job templates created by this chart"""
        release_name = "test-basic"
        k8s_objects = render_chart(
            name=release_name,
            values={