Skip to content

Commit

Permalink
Merge pull request radondb#308 from acekingke/replicaIsZero
Browse files Browse the repository at this point in the history
mysqlcluster: support replica is 0, but data need to be reserverd radondb#304
  • Loading branch information
andyli029 authored Nov 26, 2021
2 parents 11f5ab2 + 9a72cf3 commit b7edd45
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions mysqlcluster/syncer/statefulset.go
Original file line number Diff line number Diff line change
Expand Up @@ -536,6 +536,10 @@ func (s *StatefulSetSyncer) ensurePodSpec() corev1.PodSpec {

// updatePVC used to update the pvc, check and remove the extra pvc.
func (s *StatefulSetSyncer) updatePVC(ctx context.Context) error {
if *s.Spec.Replicas == 0 {
log.Info("skip update pvc because replicas is 0")
return nil
}
pvcs := corev1.PersistentVolumeClaimList{}
if err := s.cli.List(ctx,
&pvcs,
Expand Down

0 comments on commit b7edd45

Please sign in to comment.