File tree Expand file tree Collapse file tree 2 files changed +6
-1
lines changed
Expand file tree Collapse file tree 2 files changed +6
-1
lines changed Original file line number Diff line number Diff line change @@ -434,6 +434,12 @@ func (c *Cluster) compareStatefulSetWith(statefulSet *appsv1.StatefulSet) *compa
434434 reasons = append (reasons , "new statefulset's pod management policy do not match" )
435435 }
436436
437+ if c .Statefulset .Spec .PersistentVolumeClaimRetentionPolicy == nil {
438+ c .Statefulset .Spec .PersistentVolumeClaimRetentionPolicy = & appsv1.StatefulSetPersistentVolumeClaimRetentionPolicy {
439+ WhenDeleted : appsv1 .RetainPersistentVolumeClaimRetentionPolicyType ,
440+ WhenScaled : appsv1 .RetainPersistentVolumeClaimRetentionPolicyType ,
441+ }
442+ }
437443 if ! reflect .DeepEqual (c .Statefulset .Spec .PersistentVolumeClaimRetentionPolicy , statefulSet .Spec .PersistentVolumeClaimRetentionPolicy ) {
438444 match = false
439445 needsReplace = true
Original file line number Diff line number Diff line change @@ -92,7 +92,6 @@ func (c *Cluster) Sync(newSpec *acidv1.Postgresql) error {
9292 }
9393 }
9494
95- c .logger .Debug ("syncing statefulsets" )
9695 if err = c .syncStatefulSet (true ); err != nil {
9796 if ! k8sutil .ResourceAlreadyExists (err ) {
9897 err = fmt .Errorf ("could not sync statefulsets: %v" , err )
You can’t perform that action at this time.
0 commit comments