- Sponsor
-
Notifications
You must be signed in to change notification settings - Fork 338
fix: do not deregister GitLab tokens which are still in use #1102
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
Conversation
Hey @kayman-mk! 👋 Thank you for your contribution to the project. Please refer to the contribution rules for a quick overview of the process. Make sure that this PR clearly explains:
With submitting this PR you confirm that you hold the rights of the code added and agree that it will published under this LICENSE. The following ChatOps commands are supported:
Simply add a comment with the command in the first line. If you need to pass more information, separate it with a blank line from the command. This message was generated automatically. You are welcome to improve it. |
🦙 MegaLinter status: ✅ SUCCESS
See detailed report in MegaLinter reports |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think it still needs a section for incrementing the counter, but looking good so far.
@long-wan-ep Yes, missed that and added it a second ago. |
@kayman-mk Thanks for adding that. I tested this out by deploying a test runner and triggering instance refreshes on the ASG. The increment is working, but the decrement is not. I took a look inside the runner instance's
|
The problem was the parameter expansion during the @long-wan-ep would appreciate a quick check from you, if you have the time |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Overall looks good, one minor thing.
Co-authored-by: long-wan-ep <[email protected]>
🤖 I have created a release *beep* *boop* --- ## [7.5.0](7.4.0...7.5.0) (2024-04-11) ### Features * add field `create_aws_s3_bucket_public_access_block` to variable `runner_worker_cache` ([#1105](#1105)) ([aa93e76](aa93e76)) ### Bug Fixes * do not deregister GitLab tokens which are still in use ([#1102](#1102)) ([9cdab00](9cdab00)) --- This PR was generated with [Release Please](https://github.com/googleapis/release-please). See [documentation](https://github.com/googleapis/release-please#release-please). --------- Co-authored-by: cattle-ops-releaser-2[bot] <134548870+cattle-ops-releaser-2[bot]@users.noreply.github.com> Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
Description
So far we haven't tracked the usage of the GitLab Runner token. In case the Runner is stopped and a new one is spawned, race conditions might occur as explained in #1062. In consequence the new Runner used a token deleted by the old Runner. This leads into downtimes as the token is no longer valid and can't be used.
This PR converts the token into a JSON format and ensures that tokens which are still in use, are not deregistered.
Fixes #1062
Migrations needed
In case you want to rollback to a previous version you have to convert the SSM parameter containing the token and usage counter in JSON format back to a plain token string.
Verification