aws / aws-cdk

The AWS Cloud Development Kit is a framework for defining cloud infrastructure in code
https://aws.amazon.com/cdk
Apache License 2.0
11.71k stars 3.93k forks source link

@aws-cdk/aws-eks: `cluster.addHelmChart` doesn't pass `SkipCrds` #31831

Open dancmeyers opened 1 month ago

dancmeyers commented 1 month ago

Describe the bug

The kubectl custom resource handler has a special path for handling helm charts. This path has a property for SkipCrds, which should do as expected:

https://github.com/aws/aws-cdk/blob/318eae6c9eca456e0c34ed21855dad9d2bfa2a0f/packages/%40aws-cdk/custom-resource-handlers/lib/aws-eks/kubectl-handler/helm/__init__.py#L55

The helm function also accepts a skip_crds argument:

https://github.com/aws/aws-cdk/blob/318eae6c9eca456e0c34ed21855dad9d2bfa2a0f/packages/%40aws-cdk/custom-resource-handlers/lib/aws-eks/kubectl-handler/helm/__init__.py#L161

But the line that links the two together does not pass that argument, so it is impossible to tell cluster.addHelmChart not to install CRDs:

https://github.com/aws/aws-cdk/blob/318eae6c9eca456e0c34ed21855dad9d2bfa2a0f/packages/%40aws-cdk/custom-resource-handlers/lib/aws-eks/kubectl-handler/helm/__init__.py#L94

Regression Issue

Last Known Working CDK Version

No response

Expected Behavior

Passing skipCrds to cluster.addHelmChart should bypass installing CRDs via helm.

Current Behavior

CRDs are still installed via helm even if skipCrds is given as an argument to cluster.addHelmChart.

Reproduction Steps

Possible Solution

The source of the Python kubectl-handler lambda needs to be updated to correctly pass this argument.

Additional Information/Context

No response

CDK CLI Version

2.162.1 (build 10aa526)

Framework Version

No response

Node.js Version

20.18.0

OS

MacOS Sequoia 15.0.1

Language

TypeScript

Language Version

TypeScript (5.6.3), Python 3.11

Other information

No response

pahud commented 1 month ago

I just read your PR. Yes, looks like that was a miss. Thank you for the report and PR.