8000
Skip to content

fix: active runner check - #1

Open
n3xt-cr wants to merge 42 commits into
mainfrom
fix/7530-orphan-runner-verification
Open

fix: active runner check #1
n3xt-cr wants to merge 42 commits into
mainfrom
fix/7530-orphan-runner-verification

Conversation

@n3xt-cr
@n3xt-cr n3xt-cr commented Mar 18, 2026
Copy link
Copy Markdown
Collaborator

No description provided.

Signed-off-by: Gabriel Adrian Samfira <gsamfira@cloudbasesolutions.com>
Signed-off-by: Gabriel Adrian Samfira <gsamfira@cloudbasesolutions.com>
The k8s operator seems to want to define its own endpoint. This change
allows the removal of the default gh endpoint if no credentials are tied
to it.

Signed-off-by: Gabriel Adrian Samfira <gsamfira@cloudbasesolutions.com>
…-mutable

Make the default github.com endpoint mutable
Signed-off-by: Gabriel Adrian Samfira <gsamfira@cloudbasesolutions.com>
This change triggers tests for PRs created against release/* branches.

Signed-off-by: Gabriel Adrian Samfira <gsamfira@cloudbasesolutions.com>
Signed-off-by: Gabriel Adrian Samfira <gsamfira@cloudbasesolutions.com>
Signed-off-by: Gabriel Adrian Samfira <gsamfira@cloudbasesolutions.com>
Signed-off-by: Gabriel Adrian Samfira <gsamfira@cloudbasesolutions.com>
This change sets the github client http transport options to mirror those
of the default transport from Go, with the addition of the TLSClientConfig.

Signed-off-by: Gabriel Adrian Samfira <gsamfira@cloudbasesolutions.com>
Update all dependencies.

Signed-off-by: Gabriel Adrian Samfira <gsamfira@cloudbasesolutions.com>
Signed-off-by: Gabriel Adrian Samfira <gsamfira@cloudbasesolutions.com>
Signed-off-by: Gabriel Adrian Samfira <gsamfira@cloudbasesolutions.com>
gabriel-samfira and others added 12 commits July 20, 2025 19:26
Copy-paste typo.

Signed-off-by: Gabriel Adrian Samfira <gsamfira@cloudbasesolutions.com>
This change moves the check for max runners within the CreateInstance
function, which will check that the pool max runners is not yet reached
within a transaction before creating a new instance.

Signed-off-by: Gabriel Adrian Samfira <gsamfira@cloudbasesolutions.com>
Signed-off-by: Gabriel Adrian Samfira <gsamfira@cloudbasesolutions.com>
It seems that on some systems like k8s, rfc 1123 is a hard requirement
and validation fails if hostnames have any uppercase letters, leading to
nodes not being able to join.

This change makes all runner names lowercase, hopefully fixing this.

Signed-off-by: Gabriel Adrian Samfira <gsamfira@cloudbasesolutions.com>
Signed-off-by: Gabriel Adrian Samfira <gsamfira@cloudbasesolutions.com>
Equinix metal is no longer available as a service. This change removes
references to Qeuinix metal.

Signed-off-by: Gabriel Adrian Samfira <gsamfira@cloudbasesolutions.com>
Equinix metal is no longer available as a service. This change removes
references to Qeuinix metal.

Signed-off-by: Gabriel Adrian Samfira <gsamfira@cloudbasesolutions.com>
… GitHub verification

Addresses ticket #7530: Garm's cleanupOrphanedProviderRunners was deleting active runners
because they were missing from the bulk GetGithubRunners() list (due to pagination,
rate limiting, or API transients). This resulted in jobs being killed mid-execution.

Changes:
1. Added GetEntityRunner() API method to github client interface and implementations
   - Allows targeted lookup of a single runner by GitHub runner ID
   - Implemented for repository, organization, and enterprise scopes
   - Adds comprehensive error handling and metrics

2. Enhanced cleanupOrphanedProviderRunners logic:
   - For active runners missing from bulk list, now performs targeted verification
   - If GetEntityRunner(agentID) succeeds, runner is retained (bulk list had gap)
   - If GitHub returns 404, runner is treated as true orphan
   - If API errors occur, cleanup is skipped (fail-safe on transient issues)
   - Fallback to name-based lookup for runners without AgentID

3. Updated test infrastructure:
   - Added stub implementation in stub_client.go
   - Generated mock implementations for testing frameworks

This prevents both false-positive deletions (active runners killed) and resource leaks
(missed webhooks keeping dead runners forever) by requiring external verification.

Fixes: #7530
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.

2 participants

0