terraform-aws-gitlab-runner
terraform-aws-gitlab-runner copied to clipboard
Runner token usage counter not decrementing when terminating old instance
trafficstars
Describe the bug
The usage counter in the runner token SSM parameter is not decrementing when old runner instances are terminated. I feel like remove-gitlab-registration.service is not running on termination, since I don't see the expected "Token still in use. GitLab Runner not removed from GitLab." message in the logs.
To Reproduce
Steps to reproduce the behavior:
- Deploy a runner on version 7.7 of the module
- Verify the usage counter for the runner token SSM param is 1
- Make a update to the runner config that would result in a runner refresh
- Wait for graceful terminate to complete and the old runner instance is terminated
- Check the usage counter again, which will show 2 instead of 1
Expected behavior
The usage counter should increment when a new runner instance spins up, and decrement when an old runner instance terminates.