Skip to content
This repository has been archived by the owner on Feb 11, 2025. It is now read-only.

WIP - Catch signals while running terraform commands to allow clean termination #76

Closed
wants to merge 2 commits into from

Conversation

bobh66
Copy link
Collaborator

@bobh66 bobh66 commented Jul 14, 2022

Description of your changes

Add signal handling when calling terraform commands that lock state so that the command can be gracefully terminated to clean up the workspace state locking.

Fixes #46

I have:

  • Read and followed Crossplane's contribution process.
  • Run make reviewable test to ensure this PR is ready for review.

How has this code been tested

Created a Workspace that has a terraform time_sleep resource with create_timeout set to 5 minutes and uses the terraform kubernetes backend

While tailing the pod log apply the workspace and observe that the reconcile of the workspace starts

Retrieve the list of kubernetes lease resources and observe that there is a lease for the specified workspace

Terminate the provider pod and observe in the logs that the process gets terminated. Observe that the Lease for the workspace has been deleted.

bobh66 added 2 commits July 11, 2022 12:38
Signed-off-by: Bob Haddleton <bob.haddleton@nokia.com>
Signed-off-by: Bob Haddleton <bob.haddleton@nokia.com>
@bobh66
Copy link
Collaborator Author

bobh66 commented Jan 16, 2024

This PR has been moved to the new repository: upbound/provider-terraform#231

@bobh66 bobh66 closed this Jan 16, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Handle tf state lock during the controller pod restart/upgrade
1 participant