# Merge of default customEnvs and service specific custonEnvs does not work

**URL:** https://hub.mender.io/t/merge-of-default-customenvs-and-service-specific-custonenvs-does-not-work/7626
**Category:** General Discussions
**Tags:** helm
**Created:** [March 12, 2025, 10:41am UTC](https://hub.mender.io/t/merge-of-default-customenvs-and-service-specific-custonenvs-does-not-work/7626 "2025-03-12T10:41:00Z")
**Posts on this page:** 1
**Page:** 1

<div class="post-metadata">

### Author: ![thall](https://yyz2.discourse-cdn.com/flex036/user_avatar/hub.mender.io/thall/32/2393_2.png) [@thall](https://hub.mender.io/u/thall)
#### Post date: [March 12, 2025, 10:41am UTC](https://hub.mender.io/t/merge-of-default-customenvs-and-service-specific-custonenvs-does-not-work/7626/1 "2025-03-12T10:41:00Z")

</div>

Hi,

When defining both `default.customEnvs` variables and `deployments.customEnvs`, only the values from `deployments.customEnvs` are included in the result, which is unexpected, I expect all values to be present.

A merge of both variables is done [here](https://github.com/mendersoftware/mender-helm/blob/master/mender/templates/deployments/_podtemplate.yaml#L115)

I have created example to reproduce the bug on master (`55b8e3c01f317c10426273de23b6e3c67b0d799f`).

Run following command with the uploaded files values.yaml and overrides.yaml:

```auto
helm template mender -f values.yaml -f overrides.yaml -s templates/deployments/deployment.yaml

```

[values.yaml](https://hub.mender.io/uploads/short-url/xJbgdcH5Q1bdtOmmoEVaNHVasXX.yaml) (2.1 KB)  
[overrides.yaml](https://hub.mender.io/uploads/short-url/zU9B5HRSXMY5gUAFc8qmZidbZYt.yaml) (182 Bytes)

```auto
default:
  customEnvs:
    - name: LOG_FORMAT
      value: "json"

deployments:
  customEnvs:
    - name: DEPLOYMENTS_STORAGE_PROXY_URI
      value: "https://storage.googleapis.com"

```

[output.yaml](https://hub.mender.io/uploads/short-url/iytDvWqGvkcZlY2MelRQn4LwT5P.yaml) (3.0 KB)

I expect the result to be:

```auto
        env:
        - name: DEPLOYMENTS_STORAGE_DEFAULT
          value: "aws"
        - name: DEPLOYMENTS_INVENTORY_ADDR
          value: http://mender-inventory:8080
        - name: DEPLOYMENTS_MIDDLEWARE
          value: "prod"
        - name: DEPLOYMENTS_AWS_TAG_ARTIFACT
          value:
        - name: DEPLOYMENTS_STORAGE_ENABLE_DIRECT_UPLOAD
          value: "true"
        - name: DEPLOYMENTS_STORAGE_PROXY_URI
          value: "https://mender.einride.dev"
        - name: DEPLOYMENTS_STORAGE_PROXY_URI
          value: https://storage.googleapis.comlol
        - name: LOG_FORMAT <=== I expect this to be rendered.
          value: json <=== I expect this to be rendered.

```

Do I have the right expectations or do have I missed something?
