Fix for gitea tools and scale set cleanup

Filter out gitea tools to only consider archived downloads. This
should help in situations where bandwidth is more important than
CPU time used to unarchive the tools.

Also a drive by fix for scale sets cleanup.

Signed-off-by: Gabriel Adrian Samfira <gsamfira@cloudbasesolutions.com>
This commit is contained in:
Gabriel Adrian Samfira 2025-08-12 09:21:43 +00:00
parent 325bca4af3
commit 5a6ac12118
3 changed files with 13 additions and 1 deletions

View file

@ -88,7 +88,9 @@ The filter is defined as a JSON that you write over the websocket connections. T
"job",
"controller",
"github_credentials",
"github_endpoint"
"gitea_credentials",
"github_endpoint",
"scaleset"
],
"title": "entity type",
"description": "The type of entity to filter on",

View file

@ -180,6 +180,10 @@ func getTools(ctx context.Context) ([]commonParams.RunnerApplicationDownload, er
slog.InfoContext(ctx, "ignoring unrecognized tools os", "tool", asset.Name)
continue
}
if !strings.HasSuffix(asset.DownloadURL, ".xz") {
// filter out non compressed versions.
continue
}
ret = append(ret, commonParams.RunnerApplicationDownload{
OS: os,
Architecture: arch,

View file

@ -193,6 +193,12 @@ func (w *Worker) Start() (err error) {
return fmt.Errorf("updating runner %s: %w", instance.Name, err)
}
}
} else if instance.Status == commonParams.InstanceDeleted {
if err := w.handleInstanceCleanup(instance); err != nil {
locking.Unlock(instance.Name, false)
return fmt.Errorf("failed to remove database entry for %s: %w", instance.Name, err)
}
continue
}
w.runners[instance.ID] = instance
locking.Unlock(instance.Name, false)