diff --git a/runner/pool/common.go b/runner/pool/common.go index 77b11d22..813f2504 100644 --- a/runner/pool/common.go +++ b/runner/pool/common.go @@ -536,25 +536,8 @@ func (r *basePool) cleanupOrphanedGithubRunners(runners []*github.Runner) error } removeRunner := false - poolID, err := r.poolIDFromLabels(runner.Labels) - if err != nil { - if !errors.Is(err, runnerErrors.ErrNotFound) { - return errors.Wrap(err, "finding pool") - } - // not a runner we manage - continue - } - pool, err := r.helper.GetPoolByID(poolID) - if err != nil { - if !errors.Is(err, runnerErrors.ErrNotFound) { - return errors.Wrap(err, "fetching pool") - } - // not pool we manage. - continue - } - - dbInstance, err := r.store.GetPoolInstanceByName(r.ctx, poolID, *runner.Name) + dbInstance, err := r.store.GetInstanceByName(r.ctx, *runner.Name) if err != nil { if !errors.Is(err, runnerErrors.ErrNotFound) { return errors.Wrap(err, "fetching instance from DB") @@ -563,6 +546,11 @@ func (r *basePool) cleanupOrphanedGithubRunners(runners []*github.Runner) error // removal may have failed? removeRunner = true } else { + pool, err := r.helper.GetPoolByID(dbInstance.PoolID) + if err != nil { + return errors.Wrap(err, "fetching pool") + } + if providerCommon.InstanceStatus(dbInstance.Status) == providerCommon.InstancePendingDelete { // already marked for deleting. Let consolidate take care of it. continue diff --git a/util/util.go b/util/util.go index be441c81..b09f3237 100644 --- a/util/util.go +++ b/util/util.go @@ -61,6 +61,7 @@ var ( "centos": config.Linux, "suse": config.Linux, "fedora": config.Linux, + "debian": config.Linux, "flatcar": config.Linux, "gentoo": config.Linux, "windows": config.Windows,