Skip to content
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

fix: signal handling for Concourse 7.5 #164

Merged
merged 1 commit into from
Nov 2, 2021
Merged

Conversation

blgm
Copy link
Contributor

@blgm blgm commented Oct 28, 2021

There seems to be a change (unidentified as yet) in Concourse 7.5 that
results in no longer being able to stop or time-out once Terraform is
running. This change introduces a wrapper around the Terraform command
that catches signals and kills the Terraform process group if one is
detected.

Resolves #163

Notes:

  • I haven't run the integration tests as they were tricky to set up, and I don't think they would catch errors in the changes that I made. I have however run this in my pipeline for a few days
  • There's an argument that rather than using fmt.Printf() for logging, logger.Logger should be used instead. But I found that in order to pass logger.Logger then I would have to make a lot of changes in a lot of layers. I'm happy making this change if that's preferred.
  • I did consider merging client.terraformCmd() into the new runner package to create a "tfrunner" package, but it looked like it would be a bigger change and wasn't clearly a better implementation.

There seems to be a change (unidentified as yet) in Concourse 7.5 that
results in no longer being able to stop or time-out once Terraform is
running. This change introduces a wrapper around the Terraform command
that catches signals and kills the Terraform process group if one is
detected.
@tinygrasshopper
Copy link

hey @ljfranklin, any thoughts on this PR.

We are currently using a forked version of the resource, it would be great to get back to using main.

@ljfranklin ljfranklin merged commit 2e64e3e into ljfranklin:master Nov 2, 2021
@ljfranklin
Copy link
Owner

Thanks for the PR @blgm! The fix is now available in ljfranklin/terraform-resource:latest and ljfranklin/terraform-resource:1.0.10 images.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Timeout no longer seems to work with Concourse v7.5.0
3 participants