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

fix(eks): cluster-resource-handler fails to verify delete operations #26375

Closed
wants to merge 9 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ export class ClusterResourceHandler extends ResourceHandler {
try {
await this.eks.deleteCluster({ name: this.clusterName });
} catch (e: any) {
if (e.code !== 'ResourceNotFoundException') {
if (e.$metadata.httpStatusCode !== 404) {
throw e;
} else {
console.log(`cluster ${this.clusterName} not found, idempotently succeeded`);
Expand All @@ -88,8 +88,8 @@ export class ClusterResourceHandler extends ResourceHandler {
const resp = await this.eks.describeCluster({ name: this.clusterName });
console.log('describeCluster returned:', JSON.stringify(resp, undefined, 2));
} catch (e: any) {
if (e.code === 'ResourceNotFoundException') {
console.log('received ResourceNotFoundException, this means the cluster has been deleted (or never existed)');
if (e.$metadata.httpStatusCode === 404) {
console.log('received 404, this means the cluster has been deleted (or never existed)');
return { IsComplete: true };
}

Expand Down

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -107,8 +107,8 @@ export class FargateProfileResourceHandler extends ResourceHandler {

return status;
} catch (describeFargateProfileError: any) {
if (describeFargateProfileError.code === 'ResourceNotFoundException') {
this.log('received ResourceNotFoundException, this means the profile has been deleted (or never existed)');
if (describeFargateProfileError.$metadata.httpStatusCode === 404) {
this.log('received 404, this means the profile has been deleted (or never existed)');
return 'NOT_FOUND';
}

Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -27,15 +27,15 @@
}
}
},
"a46179e8334ce45c3cbb975d0dfe34028e095aa8dfa55496bbc7717623351649": {
"5c9562d0ac61a1465a168c71e161265c2578a14a4236becaac93bf7f9fe70e92": {
"source": {
"path": "asset.a46179e8334ce45c3cbb975d0dfe34028e095aa8dfa55496bbc7717623351649",
"path": "asset.5c9562d0ac61a1465a168c71e161265c2578a14a4236becaac93bf7f9fe70e92",
"packaging": "zip"
},
"destinations": {
"current_account-current_region": {
"bucketName": "cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}",
"objectKey": "a46179e8334ce45c3cbb975d0dfe34028e095aa8dfa55496bbc7717623351649.zip",
"objectKey": "5c9562d0ac61a1465a168c71e161265c2578a14a4236becaac93bf7f9fe70e92.zip",
"assumeRoleArn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-file-publishing-role-${AWS::AccountId}-${AWS::Region}"
}
}
Expand Down Expand Up @@ -118,15 +118,15 @@
}
}
},
"5668822355521ba6595d0d082996b9c5c1d1b047f32bd57bf98780960aadea2d": {
"0d97acfcabaa747fb659c83ba64f5ac8c8a4cd6de673da0605fcb611a9b95e20": {
"source": {
"path": "awscdkeksclusteralbcontrollertestawscdkawseksClusterResourceProvider5DBBAFBB.nested.template.json",
"packaging": "file"
},
"destinations": {
"current_account-current_region": {
"bucketName": "cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}",
"objectKey": "5668822355521ba6595d0d082996b9c5c1d1b047f32bd57bf98780960aadea2d.json",
"objectKey": "0d97acfcabaa747fb659c83ba64f5ac8c8a4cd6de673da0605fcb611a9b95e20.json",
"assumeRoleArn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-file-publishing-role-${AWS::AccountId}-${AWS::Region}"
}
}
Expand All @@ -144,15 +144,15 @@
}
}
},
"d22501e675c0b5ebc6b919ce32ebad5790ef1f1c3a24785733a1ea78217ecc54": {
"9e28c564f70c57302958f9eba9a956bd712cd97d5b23d4c018368b43228b2e45": {
"source": {
"path": "aws-cdk-eks-cluster-alb-controller-test.template.json",
"packaging": "file"
},
"destinations": {
"current_account-current_region": {
"bucketName": "cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}",
"objectKey": "d22501e675c0b5ebc6b919ce32ebad5790ef1f1c3a24785733a1ea78217ecc54.json",
"objectKey": "9e28c564f70c57302958f9eba9a956bd712cd97d5b23d4c018368b43228b2e45.json",
"assumeRoleArn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-file-publishing-role-${AWS::AccountId}-${AWS::Region}"
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1055,7 +1055,7 @@
{
"Fn::Sub": "cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}"
},
"/5668822355521ba6595d0d082996b9c5c1d1b047f32bd57bf98780960aadea2d.json"
"/0d97acfcabaa747fb659c83ba64f5ac8c8a4cd6de673da0605fcb611a9b95e20.json"
]
]
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@
"S3Bucket": {
"Fn::Sub": "cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}"
},
"S3Key": "a46179e8334ce45c3cbb975d0dfe34028e095aa8dfa55496bbc7717623351649.zip"
"S3Key": "5c9562d0ac61a1465a168c71e161265c2578a14a4236becaac93bf7f9fe70e92.zip"
},
"Role": {
"Fn::GetAtt": [
Expand Down Expand Up @@ -115,7 +115,7 @@
"S3Bucket": {
"Fn::Sub": "cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}"
},
"S3Key": "a46179e8334ce45c3cbb975d0dfe34028e095aa8dfa55496bbc7717623351649.zip"
"S3Key": "5c9562d0ac61a1465a168c71e161265c2578a14a4236becaac93bf7f9fe70e92.zip"
},
"Role": {
"Fn::GetAtt": [
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
"stacks": [
"aws-cdk-eks-cluster-alb-controller-test"
],
"diffAssets": true,
"assertionStack": "aws-cdk-cluster-alb-controller/DefaultTest/DeployAssert",
"assertionStackName": "awscdkclusteralbcontrollerDefaultTestDeployAssert78AE94CA"
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
"validateOnSynth": false,
"assumeRoleArn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-deploy-role-${AWS::AccountId}-${AWS::Region}",
"cloudFormationExecutionRoleArn": "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/cdk-hnb659fds-cfn-exec-role-${AWS::AccountId}-${AWS::Region}",
"stackTemplateAssetObjectUrl": "s3://cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}/d22501e675c0b5ebc6b919ce32ebad5790ef1f1c3a24785733a1ea78217ecc54.json",
"stackTemplateAssetObjectUrl": "s3://cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}/9e28c564f70c57302958f9eba9a956bd712cd97d5b23d4c018368b43228b2e45.json",
"requiresBootstrapStackVersion": 6,
"bootstrapStackVersionSsmParameter": "/cdk-bootstrap/hnb659fds/version",
"additionalDependencies": [
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1563,7 +1563,7 @@
"s3Bucket": {
"Fn::Sub": "cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}"
},
"s3Key": "a46179e8334ce45c3cbb975d0dfe34028e095aa8dfa55496bbc7717623351649.zip"
"s3Key": "5c9562d0ac61a1465a168c71e161265c2578a14a4236becaac93bf7f9fe70e92.zip"
},
"role": {
"Fn::GetAtt": [
Expand Down Expand Up @@ -1695,7 +1695,7 @@
"s3Bucket": {
"Fn::Sub": "cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}"
},
"s3Key": "a46179e8334ce45c3cbb975d0dfe34028e095aa8dfa55496bbc7717623351649.zip"
"s3Key": "5c9562d0ac61a1465a168c71e161265c2578a14a4236becaac93bf7f9fe70e92.zip"
},
"role": {
"Fn::GetAtt": [
Expand Down Expand Up @@ -2601,7 +2601,7 @@
{
"Fn::Sub": "cdk-hnb659fds-assets-${AWS::AccountId}-${AWS::Region}"
},
"/5668822355521ba6595d0d082996b9c5c1d1b047f32bd57bf98780960aadea2d.json"
"/0d97acfcabaa747fb659c83ba64f5ac8c8a4cd6de673da0605fcb611a9b95e20.json"
]
]
}
Expand Down
Loading
Loading