New function for creating missing pvcs

This commit is contained in:
Rahul Rangith
2023-01-06 17:22:26 -05:00
parent 8924b58e2c
commit 2f0eb543c7
2 changed files with 17 additions and 8 deletions

View File

@@ -453,16 +453,9 @@ func (ssc *defaultStatefulSetControl) updateStatefulSet(
set.Namespace,
set.Name,
replicas[i].Name)
if err := ssc.podControl.createPersistentVolumeClaims(set, replicas[i]); err != nil {
if err := ssc.podControl.createMissingPersistentVolumeClaims(set, replicas[i]); err != nil {
return &status, err
}
if utilfeature.DefaultFeatureGate.Enabled(features.StatefulSetAutoDeletePVC) {
// Set PVC policy as much as is possible at this point.
if err := ssc.podControl.UpdatePodClaimForRetentionPolicy(set, replicas[i]); err != nil {
ssc.podControl.recordPodEvent("update", set, replicas[i], err)
return &status, err
}
}
}
// If we find a Pod that is currently terminating, we must wait until graceful deletion
// completes before we continue to make progress.