Skip to content

Commit 9088d04

Browse files
authored
chore(eks): fix integ tests (#25448)
This PR fixes 2 integ tests from aws-eks. - `integ.eks-helm-assets` is failing because 2 helm charts are trying to install with the same release name and this is failing with race condition. This PR replaces one of them with another helm chart from ACK to avoid that and ensures the integ test will succeed. - `integ.eks-service-account-sdk-call` is missing `package.json` and `sdk-call.js` as described in #25178 and `docker build` is failing due to missing files. We restored them from [v2.72.1](https://github.com/aws/aws-cdk/tree/v2.72.1/packages/%40aws-cdk/aws-eks/test/sdk-call-integ-test-docker-app/app) with minor update on the test. Now both integ tests can successfully run with no error. Closes #25438 #25178 ---- *By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license*
1 parent ce7bdea commit 9088d04

26 files changed

+210
-163
lines changed

packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.eks-helm-asset.js.snapshot/aws-cdk-eks-helm-test.assets.json

+12-12
Original file line numberDiff line numberDiff line change
@@ -14,15 +14,15 @@
1414
}
1515
}
1616
},
17-
"ad44c2b0638f04871c889d78e71dea90ffae67b9cc4aa4366d5102db42435ee1": {
17+
"75dfa9114a30421542432dcb55212f010f591a9e3bd203ae98ba3f9bedf5bb31": {
1818
"source": {
19-
"path": "asset.ad44c2b0638f04871c889d78e71dea90ffae67b9cc4aa4366d5102db42435ee1.zip",
19+
"path": "asset.75dfa9114a30421542432dcb55212f010f591a9e3bd203ae98ba3f9bedf5bb31.zip",
2020
"packaging": "file"
2121
},
2222
"destinations": {
2323
"current_account-current_region": {
2424
"bucketName": "cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}",
25-
"objectKey": "ad44c2b0638f04871c889d78e71dea90ffae67b9cc4aa4366d5102db42435ee1.zip",
25+
"objectKey": "75dfa9114a30421542432dcb55212f010f591a9e3bd203ae98ba3f9bedf5bb31.zip",
2626
"assumeRoleArn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-file-publishing-role-${AWS::AccountId}-${AWS::Region}"
2727
}
2828
}
@@ -66,15 +66,15 @@
6666
}
6767
}
6868
},
69-
"68b22621fff135f9e3f225bad7ff80fdf2f45c3d9910af601206a0d9b279933a": {
69+
"ae425a54db1deda1936d2f7a541020d40ec5b16e8334c1c068761a8fafa0275f": {
7070
"source": {
71-
"path": "asset.68b22621fff135f9e3f225bad7ff80fdf2f45c3d9910af601206a0d9b279933a.zip",
71+
"path": "asset.ae425a54db1deda1936d2f7a541020d40ec5b16e8334c1c068761a8fafa0275f.zip",
7272
"packaging": "file"
7373
},
7474
"destinations": {
7575
"current_account-current_region": {
7676
"bucketName": "cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}",
77-
"objectKey": "68b22621fff135f9e3f225bad7ff80fdf2f45c3d9910af601206a0d9b279933a.zip",
77+
"objectKey": "ae425a54db1deda1936d2f7a541020d40ec5b16e8334c1c068761a8fafa0275f.zip",
7878
"assumeRoleArn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-file-publishing-role-${AWS::AccountId}-${AWS::Region}"
7979
}
8080
}
@@ -92,41 +92,41 @@
9292
}
9393
}
9494
},
95-
"6f61015f64f5df19d0afe8f154e61f20d67d5b05deae3d6099588b1f777283dd": {
95+
"5b02ca2b54c47e5d63d0ca0a66e23ae63d5ce9f0fd7a049c4674eece3c96073c": {
9696
"source": {
9797
"path": "awscdkekshelmtestawscdkawseksClusterResourceProviderB64048CD.nested.template.json",
9898
"packaging": "file"
9999
},
100100
"destinations": {
101101
"current_account-current_region": {
102102
"bucketName": "cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}",
103-
"objectKey": "6f61015f64f5df19d0afe8f154e61f20d67d5b05deae3d6099588b1f777283dd.json",
103+
"objectKey": "5b02ca2b54c47e5d63d0ca0a66e23ae63d5ce9f0fd7a049c4674eece3c96073c.json",
104104
"assumeRoleArn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-file-publishing-role-${AWS::AccountId}-${AWS::Region}"
105105
}
106106
}
107107
},
108-
"8b84bcd1e0d8afe44c4d60f383eff6198959df6bd3cabb51a3e53cc82d7b1a14": {
108+
"e3a4dac33dc383e61cc901caf9c2178953ede1626a8568e3c4984ccc28a61579": {
109109
"source": {
110110
"path": "awscdkekshelmtestawscdkawseksKubectlProvider207F42E4.nested.template.json",
111111
"packaging": "file"
112112
},
113113
"destinations": {
114114
"current_account-current_region": {
115115
"bucketName": "cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}",
116-
"objectKey": "8b84bcd1e0d8afe44c4d60f383eff6198959df6bd3cabb51a3e53cc82d7b1a14.json",
116+
"objectKey": "e3a4dac33dc383e61cc901caf9c2178953ede1626a8568e3c4984ccc28a61579.json",
117117
"assumeRoleArn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-file-publishing-role-${AWS::AccountId}-${AWS::Region}"
118118
}
119119
}
120120
},
121-
"997e65453c73f88f0df66d7761e4ccd19d53c7d2f544eaa077006ae7e1cef1e1": {
121+
"cecb99ddab714f4d566172c451eba566ce38a878587bf59ef0c488069bfd5ed2": {
122122
"source": {
123123
"path": "aws-cdk-eks-helm-test.template.json",
124124
"packaging": "file"
125125
},
126126
"destinations": {
127127
"current_account-current_region": {
128128
"bucketName": "cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}",
129-
"objectKey": "997e65453c73f88f0df66d7761e4ccd19d53c7d2f544eaa077006ae7e1cef1e1.json",
129+
"objectKey": "cecb99ddab714f4d566172c451eba566ce38a878587bf59ef0c488069bfd5ed2.json",
130130
"assumeRoleArn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-file-publishing-role-${AWS::AccountId}-${AWS::Region}"
131131
}
132132
}

packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.eks-helm-asset.js.snapshot/aws-cdk-eks-helm-test.template.json

+6-6
Original file line numberDiff line numberDiff line change
@@ -991,11 +991,11 @@
991991
"Arn"
992992
]
993993
},
994-
"Release": "lambda-chart-release",
995-
"Chart": "lambda-chart",
996-
"Version": "v0.1.4",
994+
"Release": "rds-chart-release",
995+
"Chart": "rds-chart",
996+
"Version": "v1.1.2",
997997
"Namespace": "ack-system",
998-
"Repository": "oci://public.ecr.aws/aws-controllers-k8s/lambda-chart",
998+
"Repository": "oci://public.ecr.aws/aws-controllers-k8s/rds-chart",
999999
"CreateNamespace": true,
10001000
"SkipCrds": true
10011001
},
@@ -1055,7 +1055,7 @@
10551055
{
10561056
"Fn::Sub": "cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}"
10571057
},
1058-
"/6f61015f64f5df19d0afe8f154e61f20d67d5b05deae3d6099588b1f777283dd.json"
1058+
"/5b02ca2b54c47e5d63d0ca0a66e23ae63d5ce9f0fd7a049c4674eece3c96073c.json"
10591059
]
10601060
]
10611061
},
@@ -1090,7 +1090,7 @@
10901090
{
10911091
"Fn::Sub": "cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}"
10921092
},
1093-
"/8b84bcd1e0d8afe44c4d60f383eff6198959df6bd3cabb51a3e53cc82d7b1a14.json"
1093+
"/e3a4dac33dc383e61cc901caf9c2178953ede1626a8568e3c4984ccc28a61579.json"
10941094
]
10951095
]
10961096
},

packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.eks-helm-asset.js.snapshot/awscdkekshelmtestawscdkawseksClusterResourceProviderB64048CD.nested.template.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
"S3Bucket": {
88
"Fn::Sub": "cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}"
99
},
10-
"S3Key": "ad44c2b0638f04871c889d78e71dea90ffae67b9cc4aa4366d5102db42435ee1.zip"
10+
"S3Key": "75dfa9114a30421542432dcb55212f010f591a9e3bd203ae98ba3f9bedf5bb31.zip"
1111
},
1212
"Description": "/opt/nodejs/node_modules/proxy-agent"
1313
}

packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.eks-helm-asset.js.snapshot/awscdkekshelmtestawscdkawseksKubectlProvider207F42E4.nested.template.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -202,7 +202,7 @@
202202
"S3Bucket": {
203203
"Fn::Sub": "cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}"
204204
},
205-
"S3Key": "68b22621fff135f9e3f225bad7ff80fdf2f45c3d9910af601206a0d9b279933a.zip"
205+
"S3Key": "ae425a54db1deda1936d2f7a541020d40ec5b16e8334c1c068761a8fafa0275f.zip"
206206
},
207207
"Description": "/opt/awscli/aws"
208208
}

packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.eks-helm-asset.js.snapshot/manifest.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
"validateOnSynth": false,
1818
"assumeRoleArn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-deploy-role-${AWS::AccountId}-${AWS::Region}",
1919
"cloudFormationExecutionRoleArn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-cfn-exec-role-${AWS::AccountId}-${AWS::Region}",
20-
"stackTemplateAssetObjectUrl": "s3://cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}/997e65453c73f88f0df66d7761e4ccd19d53c7d2f544eaa077006ae7e1cef1e1.json",
20+
"stackTemplateAssetObjectUrl": "s3://cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}/cecb99ddab714f4d566172c451eba566ce38a878587bf59ef0c488069bfd5ed2.json",
2121
"requiresBootstrapStackVersion": 6,
2222
"bootstrapStackVersionSsmParameter": "/cdk-bootstrap/hnb659fds/version",
2323
"additionalDependencies": [

packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.eks-helm-asset.js.snapshot/tree.json

+11-11
Original file line numberDiff line numberDiff line change
@@ -755,7 +755,7 @@
755755
},
756756
"constructInfo": {
757757
"fqn": "@aws-cdk/lambda-layer-kubectl-v24.KubectlV24Layer",
758-
"version": "2.0.149"
758+
"version": "2.0.176"
759759
}
760760
},
761761
"Cluster": {
@@ -1019,7 +1019,7 @@
10191019
},
10201020
"constructInfo": {
10211021
"fqn": "constructs.Construct",
1022-
"version": "10.1.270"
1022+
"version": "10.2.9"
10231023
}
10241024
},
10251025
"KubectlReadyBarrier": {
@@ -1413,7 +1413,7 @@
14131413
"s3Bucket": {
14141414
"Fn::Sub": "cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}"
14151415
},
1416-
"s3Key": "ad44c2b0638f04871c889d78e71dea90ffae67b9cc4aa4366d5102db42435ee1.zip"
1416+
"s3Key": "75dfa9114a30421542432dcb55212f010f591a9e3bd203ae98ba3f9bedf5bb31.zip"
14171417
},
14181418
"description": "/opt/nodejs/node_modules/proxy-agent"
14191419
}
@@ -2581,7 +2581,7 @@
25812581
},
25822582
"constructInfo": {
25832583
"fqn": "constructs.Construct",
2584-
"version": "10.1.270"
2584+
"version": "10.2.9"
25852585
}
25862586
}
25872587
},
@@ -2638,7 +2638,7 @@
26382638
{
26392639
"Fn::Sub": "cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}"
26402640
},
2641-
"/6f61015f64f5df19d0afe8f154e61f20d67d5b05deae3d6099588b1f777283dd.json"
2641+
"/5b02ca2b54c47e5d63d0ca0a66e23ae63d5ce9f0fd7a049c4674eece3c96073c.json"
26422642
]
26432643
]
26442644
},
@@ -2660,7 +2660,7 @@
26602660
},
26612661
"constructInfo": {
26622662
"fqn": "constructs.Construct",
2663-
"version": "10.1.270"
2663+
"version": "10.2.9"
26642664
}
26652665
},
26662666
"@aws-cdk--aws-eks.KubectlProvider": {
@@ -2986,7 +2986,7 @@
29862986
"s3Bucket": {
29872987
"Fn::Sub": "cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}"
29882988
},
2989-
"s3Key": "68b22621fff135f9e3f225bad7ff80fdf2f45c3d9910af601206a0d9b279933a.zip"
2989+
"s3Key": "ae425a54db1deda1936d2f7a541020d40ec5b16e8334c1c068761a8fafa0275f.zip"
29902990
},
29912991
"description": "/opt/awscli/aws"
29922992
}
@@ -3343,7 +3343,7 @@
33433343
{
33443344
"Fn::Sub": "cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}"
33453345
},
3346-
"/8b84bcd1e0d8afe44c4d60f383eff6198959df6bd3cabb51a3e53cc82d7b1a14.json"
3346+
"/e3a4dac33dc383e61cc901caf9c2178953ede1626a8568e3c4984ccc28a61579.json"
33473347
]
33483348
]
33493349
},
@@ -3386,7 +3386,7 @@
33863386
},
33873387
"constructInfo": {
33883388
"fqn": "constructs.Construct",
3389-
"version": "10.1.270"
3389+
"version": "10.2.9"
33903390
}
33913391
},
33923392
"ChartAsset": {
@@ -3450,7 +3450,7 @@
34503450
"path": "aws-cdk-eks-helm/DefaultTest/Default",
34513451
"constructInfo": {
34523452
"fqn": "constructs.Construct",
3453-
"version": "10.1.270"
3453+
"version": "10.2.9"
34543454
}
34553455
},
34563456
"DeployAssert": {
@@ -3496,7 +3496,7 @@
34963496
"path": "Tree",
34973497
"constructInfo": {
34983498
"fqn": "constructs.Construct",
3499-
"version": "10.1.270"
3499+
"version": "10.2.9"
35003500
}
35013501
}
35023502
},

packages/@aws-cdk-testing/framework-integ/test/aws-eks/test/integ.eks-helm-asset.ts

+4-4
Original file line numberDiff line numberDiff line change
@@ -79,10 +79,10 @@ class EksClusterStack extends Stack {
7979

8080
// testing the disable mechanism of the installation of CRDs
8181
this.cluster.addHelmChart('test-skip-crd-installation', {
82-
chart: 'lambda-chart',
83-
release: 'lambda-chart-release',
84-
repository: 'oci://public.ecr.aws/aws-controllers-k8s/lambda-chart',
85-
version: 'v0.1.4',
82+
chart: 'rds-chart',
83+
release: 'rds-chart-release',
84+
repository: 'oci://public.ecr.aws/aws-controllers-k8s/rds-chart',
85+
version: 'v1.1.2',
8686
namespace: 'ack-system',
8787
createNamespace: true,
8888
skipCrds: true,
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
{
2+
"name": "eks-service-account-sdk-call-integ-test",
3+
"private": "true",
4+
"dependencies": {
5+
"aws-sdk": "^2.1329.0"
6+
}
7+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
const sdk = require('aws-sdk');
2+
sdk.config.update({region: 'us-east-1'});
3+
4+
var s3 = new sdk.S3();
5+
const bucketName = process.env.BUCKET_NAME;
6+
s3.createBucket({ Bucket: bucketName }, function(err) {
7+
if (!err) {
8+
console.log(`Bucket ${bucketName} was created`);
9+
} else {
10+
throw new Error(`failed to create s3 bucket ${bucketName} with error: ` + err);
11+
}
12+
});

0 commit comments

Comments
 (0)