Implement strict prebuilds eligibility

See https://github.com/coder/internal/issues/372

Signed-off-by: Danny Kopping <danny@coder.com>
This commit is contained in:
Danny Kopping
2025-02-18 09:39:04 +00:00
parent e9fdd86c45
commit 9dd9fedc12
6 changed files with 159 additions and 75 deletions

View File

@ -328,7 +328,8 @@ func (c *Controller) reconcileTemplate(ctx context.Context, template database.Te
slog.F("to_create", len(actions.createIDs)), slog.F("to_delete", len(actions.deleteIDs)),
slog.F("desired", actions.meta.Desired), slog.F("actual", actions.meta.Actual),
slog.F("outdated", actions.meta.Outdated), slog.F("extraneous", actions.meta.Extraneous),
slog.F("starting", actions.meta.Starting), slog.F("stopping", actions.meta.Stopping), slog.F("deleting", actions.meta.Deleting))
slog.F("starting", actions.meta.Starting), slog.F("stopping", actions.meta.Stopping),
slog.F("deleting", actions.meta.Deleting), slog.F("eligible", actions.meta.Eligible))
// Provision workspaces within the same tx so we don't get any timing issues here.
// i.e. we hold the advisory lock until all reconciliatory actions have been taken.