diff --git a/nomad/core_sched.go b/nomad/core_sched.go index f6aa3c112..17925ecc7 100644 --- a/nomad/core_sched.go +++ b/nomad/core_sched.go @@ -767,12 +767,11 @@ func (c *CoreScheduler) csiVolumeClaimGC(eval *structs.Evaluation) error { tt := c.srv.fsm.TimeTable() cutoff := time.Now().UTC().Add(-1 * c.srv.config.CSIVolumeClaimGCThreshold) oldThreshold = tt.NearestIndex(cutoff) + c.logger.Debug("CSI volume claim GC scanning before cutoff index", + "index", oldThreshold, + "csi_volume_claim_gc_threshold", c.srv.config.CSIVolumeClaimGCThreshold) } - c.logger.Debug("CSI volume claim GC scanning before cutoff index", - "index", oldThreshold, - "csi_volume_claim_gc_threshold", c.srv.config.CSIVolumeClaimGCThreshold) - for i := iter.Next(); i != nil; i = iter.Next() { vol := i.(*structs.CSIVolume) @@ -821,11 +820,10 @@ func (c *CoreScheduler) csiPluginGC(eval *structs.Evaluation) error { tt := c.srv.fsm.TimeTable() cutoff := time.Now().UTC().Add(-1 * c.srv.config.CSIPluginGCThreshold) oldThreshold = tt.NearestIndex(cutoff) + c.logger.Debug("CSI plugin GC scanning before cutoff index", + "index", oldThreshold, "csi_plugin_gc_threshold", c.srv.config.CSIPluginGCThreshold) } - c.logger.Debug("CSI plugin GC scanning before cutoff index", - "index", oldThreshold, "csi_plugin_gc_threshold", c.srv.config.CSIPluginGCThreshold) - for i := iter.Next(); i != nil; i = iter.Next() { plugin := i.(*structs.CSIPlugin)