Reduce duplication between helpers for checking featuregate

This commit is contained in:
Hemant Kumar
2023-07-17 15:27:50 -04:00
parent 7edd72f780
commit 2e217e8cea
4 changed files with 33 additions and 38 deletions

View File

@@ -2047,7 +2047,8 @@ func ValidationOptionsForPersistentVolumeClaim(pvc, oldPvc *core.PersistentVolum
opts.AllowReadWriteOncePod = true
}
if helper.ClaimContainsAllocatedResources(oldPvc) {
if helper.ClaimContainsAllocatedResources(oldPvc) ||
helper.ClaimContainsAllocatedResourceStatus(oldPvc) {
opts.EnableRecoverFromExpansionFailure = true
}
return opts