Skip to content

Commit 5968419

Browse files
authored
Merge pull request #308 from acekingke/replicaIsZero
mysqlcluster: support replica is 0, but data need to be reserverd #304
2 parents 98a9110 + 602cb14 commit 5968419

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

mysqlcluster/syncer/statefulset.go

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -536,6 +536,10 @@ func (s *StatefulSetSyncer) ensurePodSpec() corev1.PodSpec {
536536

537537
// updatePVC used to update the pvc, check and remove the extra pvc.
538538
func (s *StatefulSetSyncer) updatePVC(ctx context.Context) error {
539+
if *s.Spec.Replicas == 0 {
540+
log.Info("skip update pvc because replicas is 0")
541+
return nil
542+
}
539543
pvcs := corev1.PersistentVolumeClaimList{}
540544
if err := s.cli.List(ctx,
541545
&pvcs,

0 commit comments

Comments
 (0)