Skip to content

Conversation

sklirg
Copy link

@sklirg sklirg commented Feb 20, 2023

…oung34-derivate

Fixes not-in-sync errors between GitHub API and running Pods when the default value for RUNNER_NAME_PREFIX is used (and likely also if RUNNER_NAME_PREFIX is set).


If the environment variable RUNNER_NAME_PREFIX is not set, then the default value of github-runner will be used as a prefix.

This shows up in GitHub Runners as such:
image

The code would originally try to match the runner name by using the name from the custom resource as a prefix, which would be incorrect in the case a RUNNER_NAME_PREFIX is not provided (or is the empty string) and the name of the CR is not "github-runner-runner-pool". Furthermore, if this variable is provided as non-empty, the same thing would occur as far as I can see.

Example configuration which triggers this is

apiVersion: garo.tietoevry.com/v1alpha1
kind: GithubActionRunner
metadata:
  namespace: github-actions-runner-operator
  name: runner-pool

With the pod template containers spec from sample, namely no env: name for RUNNER_NAME_PREFIX.

A workaround is to set the CR name to the same as RUNNER_NAME_PREFIX, e.g. both github-runner-runner-pool, but this duplicates the name and the prefix (because the pod name is templated from CR.name, like "${RUNNER_NAME_PREFIX}-${cr.Name}-${SUFFIX}") so you end up with names like "Runners / github-runner-runner-pool-github-runner-runner-pool-pod-wxvvc"

…oung34-derivate

Fixes not-in-sync between GitHub API and running Pods when the default
value for `RUNNER_NAME_PREFIX` is used (and likely also if
`RUNNER_NAME_PREFIX` is set).

Signed-off-by: Håkon Solbjørg <[email protected]>
@sklirg sklirg force-pushed the fix/no-runner-name-prefix branch from 38016dd to 22c6e82 Compare February 20, 2023 16:30
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.

1 participant