diff --git a/coderd/prebuilds/preset_snapshot.go b/coderd/prebuilds/preset_snapshot.go index 2db9694f7f376..8441a350187d2 100644 --- a/coderd/prebuilds/preset_snapshot.go +++ b/coderd/prebuilds/preset_snapshot.go @@ -72,6 +72,10 @@ type ReconciliationActions struct { BackoffUntil time.Time } +func (ra *ReconciliationActions) IsNoop() bool { + return ra.Create == 0 && len(ra.DeleteIDs) == 0 && ra.BackoffUntil.IsZero() +} + // CalculateState computes the current state of prebuilds for a preset, including: // - Actual: Number of currently running prebuilds // - Desired: Number of prebuilds desired as defined in the preset diff --git a/enterprise/coderd/prebuilds/reconcile.go b/enterprise/coderd/prebuilds/reconcile.go index 134365b65766b..1b99e46a56680 100644 --- a/enterprise/coderd/prebuilds/reconcile.go +++ b/enterprise/coderd/prebuilds/reconcile.go @@ -310,6 +310,15 @@ func (c *StoreReconciler) ReconcilePreset(ctx context.Context, ps prebuilds.Pres return nil } + // Nothing has to be done. + if !ps.Preset.UsingActiveVersion && actions.IsNoop() { + logger.Debug(ctx, "skipping reconciliation for preset - nothing has to be done", + slog.F("template_id", ps.Preset.TemplateID.String()), slog.F("template_name", ps.Preset.TemplateName), + slog.F("template_version_id", ps.Preset.TemplateVersionID.String()), slog.F("template_version_name", ps.Preset.TemplateVersionName), + slog.F("preset_id", ps.Preset.ID.String()), slog.F("preset_name", ps.Preset.Name)) + return nil + } + // nolint:gocritic // ReconcilePreset needs Prebuilds Orchestrator permissions. prebuildsCtx := dbauthz.AsPrebuildsOrchestrator(ctx) pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy