Repository navigation
fix: preserve token TTL and runner identity in v2 - #5594
Open
guicaulada wants to merge 1 commit into
Open
guicaulada wants to merge 1 commit into
guicaulada wants to merge 1 commit into
Conversation
Contributor
Dependency Review✅ No vulnerabilities or license issues or OpenSSF Scorecard issues found.Scanned FilesNone |
Contributor
There was a problem hiding this comment.
🟡 Changes recommended
The TTL validation accepts fractional values such as 0.5 that parseInt truncates to zero, causing both scale-up and pool to fail at runtime despite a successful Terraform plan/apply.
1 open issue
What changed in this PR
This PR restores token expiration settings and runner identity metadata lost when migrating to multi-runner-v2, preserving runtime cleanup behavior and the termination watcher's exact-name lookup.
Changes:
- Preserve optional token TTL settings through runner-config and forward them to scale-up and pool.
- Add a module-controlled registered-runner prefix tag that user tags cannot override.
- Add Terraform regression coverage and document the TTL input.
| File | Description |
|---|---|
modules/runner-config/variables.tf |
Adds the optional token TTL input and positive-value validation. |
modules/runner-config/tests/pool.tftest.hcl |
Tests configured, unset, zero, and negative TTL values. |
modules/runner-config/README.md |
Documents the TTL setting and updates the input schema. |
modules/runner-config/orchestration-provider.tf |
Passes configured TTL values to scale-up and pool. |
modules/compute-providers/aws/ec2/tests/provider.tftest.hcl |
Verifies that user tags cannot override the registered prefix. |
modules/compute-providers/aws/ec2/runner-instances.tf |
Adds the protected identity tag used by the termination watcher. |
Review effort: Balanced
Comment on lines
+209
to
+210
| condition = var.storage_provider.aws.ssm.ttl_seconds.tokens == null ? true : var.storage_provider.aws.ssm.ttl_seconds.tokens > 0 | ||
| error_message = "`storage_provider.aws.ssm.ttl_seconds.tokens` must be a positive number." |
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

Description
Migrating from v1 to
multi-runner-v2in v8.1.1 silently drops two settings:storage_provider.aws.ssm.ttl_seconds.tokensis accepted by multi-runner but discarded by the runner-config input schema. Scale-up and pool loseSSM_TOKEN_TTL_SECONDS, so newly written registration-token/JIT parameters no longer receive the configured expiration policy.ghr:registered_runner_name_prefix, which the termination watcher uses for exact-name lookup when no runner ID is available.Preserve the TTL through runner-config and pass it to both Lambdas through the existing storage-provider environment-variable contract. Leave the variable absent when TTL is unset and reject non-positive values. Add the module-controlled identity tag using
runner.name_prefix, which v2 uses for both JIT and bootstrap registration; user tags cannot override it.Test Plan
Related Issues
Preserves the runner identity metadata introduced in #5573 for the v2 EC2 provider.