Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

aws-eks: HelmChart values discards null values #30000

Open
trondhindenes opened this issue Apr 29, 2024 · 2 comments
Open

aws-eks: HelmChart values discards null values #30000

trondhindenes opened this issue Apr 29, 2024 · 2 comments
Labels
@aws-cdk/aws-eks Related to Amazon Elastic Kubernetes Service bug This issue is a bug. effort/medium Medium work item – several days of effort p2

Comments

@trondhindenes
Copy link

trondhindenes commented Apr 29, 2024

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 trondhindenes added bug This issue is a bug. needs-triage This issue or PR still needs to be triaged. labels Apr 29, 2024
@github-actions github-actions bot added the @aws-cdk/aws-eks Related to Amazon Elastic Kubernetes Service label Apr 29, 2024
@pahud
Copy link
Contributor

pahud commented Apr 29, 2024

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 pahud added p2 response-requested Waiting on additional info and feedback. Will move to "closing-soon" in 7 days. effort/medium Medium work item – several days of effort and removed needs-triage This issue or PR still needs to be triaged. labels Apr 29, 2024
@trondhindenes
Copy link
Author

trondhindenes commented Apr 30, 2024

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)

@github-actions github-actions bot removed the response-requested Waiting on additional info and feedback. Will move to "closing-soon" in 7 days. label Apr 30, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
@aws-cdk/aws-eks Related to Amazon Elastic Kubernetes Service bug This issue is a bug. effort/medium Medium work item – several days of effort p2
Projects
None yet
Development

No branches or pull requests

2 participants