Merge pull request #117077 from pacoxu/fsquota-cleanup

skip clear quota if FSQuotaMonitoring is disabled
This commit is contained in:
Kubernetes Prow Robot 2023-04-18 02:36:57 -07:00 committed by GitHub
commit 1f0e718585
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -519,10 +519,12 @@ func (ed *emptyDir) TearDownAt(dir string) error {
}
func (ed *emptyDir) teardownDefault(dir string) error {
// Remove any quota
err := fsquota.ClearQuota(ed.mounter, dir)
if err != nil {
klog.Warningf("Warning: Failed to clear quota on %s: %v", dir, err)
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