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

Fargate with CoreDNS Addon - Retain on Delete #905

Merged
merged 4 commits into from
Jan 11, 2024

Conversation

Howlla
Copy link
Contributor

@Howlla Howlla commented Jan 9, 2024

Issue #, if available: Relates to CDK

Description of changes:
Apply Retain on Delete policy for CoreDns Addon.

By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.

Copy link
Collaborator

@elamaran11 elamaran11 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM. @shapirov103 Pls check and merge.

Copy link
Collaborator

@shapirov103 shapirov103 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@Howlla please see my comment, happy to discuss.

* https://github.com/aws/aws-cdk/issues/28621
* */

if(clusterInfo.cluster instanceof FargateCluster && this.coreAddOnProps.addOnName === "coredns"){
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

the rule of software engineering is to avoid making more abstract (parent) dependent on private logic specific to just one of the subclasses. Can we move this fix to coredns addon? We can just call super there get the instance of the cfnAddOn to add dependency.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the recommendation @shapirov103.
Made the changes recommended

Copy link
Collaborator

@shapirov103 shapirov103 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

minor feedback, please also fix lint warnings by running make lint

* Retain the addon otherwise cluster destroy will fail due to CoreDnsComputeTypePatch
* https://github.com/aws/aws-cdk/issues/28621
*/
handleFargatePatch( addonPromise: Promise<Construct> ): Promise<Construct> {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You don't need to return anything here.

Copy link
Collaborator

@shapirov103 shapirov103 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

Great work!

@shapirov103 shapirov103 merged commit 59b45ac into aws-quickstart:main Jan 11, 2024
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants