particuleio/terraform-kubernetes-addons

[bug] Uninstallation Failure Due to Lingering Job 'tigera-operator-uninstall' Preventing Deletion

rohan-vivek opened this issue · 1 comments


Describe the bug

When attempting to uninstall the Calico module using Terraform, a job named tigera-operator-uninstall is created which prevents the deletion of the module. This job seems to be interfering with the uninstallation process.

What is the current behavior?

The uninstallation process fails with the following error message:

Error: warning: Hook pre-delete tigera-operator/templates/tigera-operator/00-uninstall.yaml failed: 1 error occurred:
	* jobs.batch "tigera-operator-uninstall" already exists

How to reproduce? Please include a code sample if relevant.

  1. Install the Calico module using Terraform.
  2. Attempt to uninstall the Calico module using Terraform.

What's the expected behavior?

The Calico module should be uninstalled successfully without any errors or interference from leftover jobs.

Are you able to fix this problem and submit a PR? Link here if you have already.

Unfortunately, I'm not able to fix this issue myself. However, I'm open to providing any additional information or testing if needed.

Environment details

  • Affected module version: 15.2.0
  • OS: Ubuntu 22.04.3 LTS (GitHub Runner)
  • Terraform version:
  • Kubernetes version: 1.29
  • Tigera-operator version: v3.27.0

Any other relevant info

After deleting the jobs manually with CLI at the same time parallelly while destruction, the process is getting completed successfully.


I don't think it can be fixed by this module. This is an issue with Calico being unable to uninstall itself I think. The solution would be to remove calico components from state before destroying the mode with:

terraform state rm $RESOURCE_NAME