From 7a30f5db9f84f9bf8a62b35dd54ae987806eeb7e Mon Sep 17 00:00:00 2001 From: Ellis Tarn Date: Thu, 25 Jan 2024 11:12:15 -0800 Subject: [PATCH] fix(eks): helm uninstall in custom resource handler does not respect `Wait` (#28830) I have a stack that installs and uninstalls helm charts, where the underlying resources use [Kubernetes Finalizers](https://kubernetes.io/docs/concepts/overview/working-with-objects/finalizers/). CDK's helm construct currently ignores `--wait`, which means that any object finalization in those helm charts is not respected in my dependency ordering. ## Compatibility I could see some debate around whether or not this is a breaking change. I'm currently viewing it as a bug fix. I'm a bit cautious about how valuable it would be to gate this behavior compared to the additional complexity. ## Testing Tested on a local fork and it worked like a charm Closes #28831 ---- *By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license* --- .../lib/aws-eks/kubectl-handler/helm/__init__.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/@aws-cdk/custom-resource-handlers/lib/aws-eks/kubectl-handler/helm/__init__.py b/packages/@aws-cdk/custom-resource-handlers/lib/aws-eks/kubectl-handler/helm/__init__.py index 3a5656f46db91..94694e4eb6251 100644 --- a/packages/@aws-cdk/custom-resource-handlers/lib/aws-eks/kubectl-handler/helm/__init__.py +++ b/packages/@aws-cdk/custom-resource-handlers/lib/aws-eks/kubectl-handler/helm/__init__.py @@ -93,7 +93,7 @@ def helm_handler(event, context): helm('upgrade', release, chart, repository, values_file, namespace, version, wait, timeout, create_namespace) elif request_type == "Delete": try: - helm('uninstall', release, namespace=namespace, timeout=timeout) + helm('uninstall', release, namespace=namespace, wait=wait, timeout=timeout) except Exception as e: logger.info("delete error: %s" % e)