Skip to content

Commit 6505913

Browse files
refactor: improve docs
1 parent 9c3484a commit 6505913

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

enterprise/coderd/prebuilds/reconcile.go

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -321,6 +321,14 @@ func (c *StoreReconciler) reportHardLimitedPresets(snapshot *prebuilds.GlobalSna
321321
// The second condition is important because a hard-limited preset that has become outdated is no longer relevant.
322322
// Its associated prebuilt workspaces were likely deleted, and it's not meaningful to continue reporting it
323323
// as hard-limited to the admin.
324+
//
325+
// This approach accounts for all relevant scenarios:
326+
// Scenario #1: The admin created a new template version with the same preset names.
327+
// Scenario #2: The admin created a new template version and renamed the presets.
328+
// Scenario #3: The admin deleted a template version that contained hard-limited presets.
329+
//
330+
// In all of these cases, only the latest and non-deleted presets will be reported.
331+
// All other presets will be ignored and eventually removed from Prometheus.
324332
isPresetHardLimited := make(map[hardLimitedPresetKey]bool)
325333
for key, presets := range presetsMap {
326334
for _, preset := range presets {

0 commit comments

Comments
 (0)