Include account_id job variable in generated pod name#310
Draft
wesleyjellis wants to merge 2 commits into
Draft
Conversation
Jobs that set an account_id variable now get it woven into the generated k8s object name (opslevel-job-<account_id>-<job_id>-<ts>), making it easier to identify which account a running job belongs to. Falls back to the existing naming scheme when account_id is absent. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
archf
reviewed
Jul 7, 2026
| } | ||
|
|
||
| // getVariable returns the value of the job variable with the given key, if present. | ||
| func getVariable(configs []opslevel.RunnerJobVariable, key string) string { |
Contributor
There was a problem hiding this comment.
There is a need for similar helper for the egress proxies. I don't mean to nitpick but it would be nice to make the name more explicit_
Suggested change
| func getVariable(configs []opslevel.RunnerJobVariable, key string) string { | |
| func getRunnerJobVariable(configs []opslevel.RunnerJobVariable, key string) string { |
| // Once we get off "the old API" method of runner we can circle back around to this | ||
| // and fix it to generate safe pod names since k8s has limitations. | ||
| var identifier string | ||
| var jobIdentifier string |
Contributor
There was a problem hiding this comment.
I don't understand the addition of this jobIdentifier 🤔
Author
There was a problem hiding this comment.
the diff makes it look weirder than it is. This block now just gets the job identifier, then line 373 constructs identifier with account id if present
Addresses review feedback: a similar helper will be needed for egress proxies, so the name should be more explicit about what it operates on. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
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.
Summary
getVariablehelper to look up a job variable by key fromjob.Variablesaccount_idjob variable (if present) into the generated pod/ConfigMap/PDB identifier, so it's easier to tell which OpsLevel account a running job pod belongs to:opslevel-job-<account_id>-<job_id>-<timestamp>opslevel-job-<job_id>-<timestamp>format when noaccount_idvariable is setTest plan
go build ./...TestGetVariable_ReturnsMatchingValue/TestGetVariable_ReturnsEmptyWhenMissingcovering the new helpergo test ./pkgpasses🤖 Generated with Claude Code