feat(eks): add atomic flag for aws-eks Helm Chart#29454
feat(eks): add atomic flag for aws-eks Helm Chart#29454mergify[bot] merged 10 commits intoaws:mainfrom
Conversation
aws-cdk-automation
left a comment
There was a problem hiding this comment.
The pull request linter has failed. See the aws-cdk-automation comment below for failure reasons. If you believe this pull request should receive an exemption, please comment and provide a justification.
A comment requesting an exemption should contain the text Exemption Request. Additionally, if clarification is needed add Clarification Request to a comment.
✅ Updated pull request passes all PRLinter validations. Dismissing previous PRLinter review.
godwingrs22
left a comment
There was a problem hiding this comment.
One small comment. Other than that LGTM.
packages/@aws-cdk/custom-resource-handlers/lib/aws-eks/kubectl-handler/helm/__init__.py
Show resolved
Hide resolved
Thank you @godwingrs22 for the review, addressed in latest rev for your final review |
| chart = chart_dir | ||
|
|
||
| helm('upgrade', release, chart, repository, values_file, namespace, version, wait, timeout, create_namespace) | ||
| helm('upgrade', release, chart, repository, values_file, namespace, version, wait, timeout, create_namespace, atomic) |
There was a problem hiding this comment.
Actually this will be passed to helm definition as skip_crds as that is the next parameter. I think
since atomic is a 12th parameter in the helm defintion, this needs to come after skip_crds is passed or you can pass the parameter explicitly like below
helm('upgrade', release, chart, repository, values_file, namespace, version, wait, timeout, create_namespace, atomic=atomic)
But not sure why the existing skip_crds is not passed to the defintion. Current code looks like it always be false and doesn't get from the resouce props. But this is different issue and just want to highlight it.
There was a problem hiding this comment.
yes it is interesting since both integration test and unit tests are passing for this too, imo it could be related to that these two flags don't need any additional handling in regards to values and will be just appended to command if set to true, somehow if this is propogating from props.atomic to underlying function, but yes this is weird that this is working for skip_crds and also have a successful tests passed
There was a problem hiding this comment.
Yeah, seems like the unit test for skip_crds to disable by default is not correct I feel. Instead it needs to find the resource with { SkipCrds: true } which will be expected to 0 like how you have handled for atomic or wait property.
godwingrs22
left a comment
There was a problem hiding this comment.
LGTM. Thanks @shikha372 for your contribution.
|
Thank you for contributing! Your pull request will be updated from main and then merged automatically (do not update manually, and be sure to allow changes to be pushed to your fork). |
|
@Mergifyio update |
☑️ Nothing to doDetails
|
|
@Mergifyio update |
❌ Mergify doesn't have permission to updateDetailsFor security reasons, Mergify can't update this pull request. Try updating locally. |
AWS CodeBuild CI Report
Powered by github-codebuild-logs, available on the AWS Serverless Application Repository |
|
Thank you for contributing! Your pull request will be updated from main and then merged automatically (do not update manually, and be sure to allow changes to be pushed to your fork). |
Issue # (if applicable)
Closes #22254.
Reason for this change
Currently, if chart is installed to the EKS cluster with wait timeout period set and fails initialization, helm will fail to send a response back to custom resource and it will be stuck in pending upgrade state (expected state is failed) .
Subsequent attempts to update the stack will result in failure while chart is stuck in
pending upgradestate until manually rolled back or deleted from the cluster.Description of changes
Added feature flag
--atomicsupported by helm currently to mark the operation as atomic which will automatically rolls back the changes in case of upgrade/installation failure.Reference doc: https://helm.sh/docs/helm/helm_install/#options
Description of how you validated changes
Added unit tests to check if flag is set as per user input in the template.
Checklist
By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license