core: log CSI GC cutoff index only on non-forced GC (#11997)

Non-CSI garbage collection tasks on the server only log the cutoff
index in the case where it's not a forced GC from `nomad system gc`.
Do the same for CSI for consistency.
This commit is contained in:
Tim Gross
2022-02-03 15:03:39 -05:00
committed by GitHub
parent e3009f1c6d
commit 364d09d363

View File

@@ -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)