-
Notifications
You must be signed in to change notification settings - Fork 205
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
Conversation
There was a problem hiding this 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.
There was a problem hiding this 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.
lib/addons/core-addon/index.ts
Outdated
* https://github.com/aws/aws-cdk/issues/28621 | ||
* */ | ||
|
||
if(clusterInfo.cluster instanceof FargateCluster && this.coreAddOnProps.addOnName === "coredns"){ |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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
There was a problem hiding this 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
lib/addons/coredns/index.ts
Outdated
* 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> { |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
Great work!
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.