Skip to content

Commit 8bb8c55

Browse files
authored
fix(eks): incorrect nodegroupName(under feature flag) (#29794)
### Issue # (if applicable) As #22910 and #25278 were closed for staleness. I am opening a new PR to fix #22442. To avoid breaking change, this PR introduces a new feature flag for the bug fix. Closes #22442 ### The Code for verification ```ts import { App, Stack, aws_eks as eks, aws_ec2 as ec2, CfnOutput, cx_api, } from 'aws-cdk-lib'; const app = new App(); const env = { region: process.env.CDK_DEFAULT_REGION, account: process.env.CDK_DEFAULT_ACCOUNT }; const stack = new Stack(app, 'my-test-stack2', { env }); stack.node.setContext(cx_api.EKS_NODEGROUP_NAME, true); const vpc = ec2.Vpc.fromLookup(stack, 'Vpc', { isDefault: true }); const cluster = new eks.Cluster(stack, 'Cluster', { vpc, version: eks.KubernetesVersion.V1_29, defaultCapacity: 0, }); const ng1 = new eks.Nodegroup(stack, 'ng-1', { cluster, }); const ng2 = cluster.addNodegroupCapacity('ng-2', { nodegroupName: 'custom-name', }); new CfnOutput(stack, 'ng1-name', { value: ng1.nodegroupName }); new CfnOutput(stack, 'ng2-name', { value: ng2.nodegroupName }); ``` The output is like ``` Outputs: my-test-stack2.ng1name = ng19F1EA947-sSziNMzPVkik my-test-stack2.ng2name = custom-name ``` Console: <img width="315" alt="image" src="https://github.com/aws/aws-cdk/assets/278432/019255bd-7d05-43ad-8624-baf5b6eea725"> ### Checklist - [x] My code adheres to the [CONTRIBUTING GUIDE](https://github.com/aws/aws-cdk/blob/main/CONTRIBUTING.md) and [DESIGN GUIDELINES](https://github.com/aws/aws-cdk/blob/main/docs/DESIGN_GUIDELINES.md) ---- *By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license*
1 parent 2da544f commit 8bb8c55

File tree

28 files changed

+1571
-1381
lines changed

28 files changed

+1571
-1381
lines changed

packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.eks-cluster.js.snapshot/asset.15197a5512179542fe2cff74af89bb047793c9c4e0b4395f114641a81cd52ae5/cfn-response.js

+88
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)