skip clear quota if FSQuotaMonitoring is disabled

This commit is contained in:
Paco Xu 2023-04-04 11:25:45 +08:00
parent c3e7eca7fd
commit 79b3126f00

View File

@ -519,11 +519,13 @@ func (ed *emptyDir) TearDownAt(dir string) error {
}
func (ed *emptyDir) teardownDefault(dir string) error {
if utilfeature.DefaultFeatureGate.Enabled(features.LocalStorageCapacityIsolationFSQuotaMonitoring) {
// Remove any quota
err := fsquota.ClearQuota(ed.mounter, dir)
if err != nil {
klog.Warningf("Warning: Failed to clear quota on %s: %v", dir, err)
}
}
// Renaming the directory is not required anymore because the operation executor
// now handles duplicate operations on the same volume
return os.RemoveAll(dir)