aws-cdk icon indicating copy to clipboard operation
aws-cdk copied to clipboard

aws-eks: HelmChart values discards null values

Open trondhindenes opened this issue 1 year ago • 3 comments

Describe the bug

Given a Helmchart config where values if configured like this:

    opentelemetry_collector_helm_chart = eks.HelmChart(
        scope,
        'opentelemetryCollectorHelmChart',
        cluster=cluster,
        chart='opentelemetry-collector',
        repository='https://open-telemetry.github.io/opentelemetry-helm-charts',
        release='opentelemetry-collector',
        namespace='telemetry',
        values={
          'thing': None,
          'thing2': 'exists'
        },
    )

the generated cloudformation template seems to completely discard any elements with a None/null value. These are important as they allow disabling default-enabled items in some helm charts.

Expected Behavior

All items including those with a null value should be carried over into the resulting helm chart values

Values json in cloudformation template should read:

      Values: '{"thing": null, "thing2":"exists"}'

Current Behavior

elements with null values are discarded, snippet from cdk synth, generated from example code:

   
      Release: opentelemetry-collector
      Chart: opentelemetry-collector
      Values: '{"thing2":"exists"}'

Reproduction Steps

See bug description

Possible Solution

No response

Additional Information/Context

Since HelmChart is a custom resource, it's not possible for users to use the normal "escape hatch" methods to get around the bug - those methods aren't available on the object it seems.

CDK CLI Version

2.127.0

Framework Version

2.139.0

Node.js Version

v20.12.2

OS

Ubuntu 23.1

Language

Python

Language Version

Python 3.11

Other information

No response

trondhindenes avatar Apr 29 '24 19:04 trondhindenes

This is new to me, I appreciate it.

Do you have any public doc link of any public helm charts with null in its values that we can reference?

pahud avatar Apr 29 '24 19:04 pahud

Hi, thanks for responding. I encountered this when setting up the opentelemetry-collector chart. It has a lot of default-enabled receivers and the doc suggests disabling the unneeded elemenets by setting them to null:

https://opentelemetry.io/docs/kubernetes/helm/collector/#configuration (the second code block in the url shows an example)

trondhindenes avatar Apr 30 '24 07:04 trondhindenes

any movement on this? I really think this bug should be adressed

trondhindenes avatar Oct 18 '24 04:10 trondhindenes