File tree Expand file tree Collapse file tree 2 files changed +10
-1
lines changed
Expand file tree Collapse file tree 2 files changed +10
-1
lines changed Original file line number Diff line number Diff line change @@ -81,7 +81,7 @@ const (
8181 statusUpToDate = "up-to-date"
8282 statusCreated = "created"
8383 statusUpdated = "updated"
84- statusFailed = "faild "
84+ statusFailed = "failed "
8585 statusOk = "ok"
8686 statusSkip = "skip"
8787)
Original file line number Diff line number Diff line change @@ -459,12 +459,21 @@ func (f *cFactory) ensureVolumes(in []core.Volume) []core.Volume {
459459}
460460
461461func (f * cFactory ) ensureVolumeClaimTemplates (in []core.PersistentVolumeClaim ) []core.PersistentVolumeClaim {
462+ initPvc := false
462463 if len (in ) == 0 {
463464 in = make ([]core.PersistentVolumeClaim , 1 )
465+ initPvc = true
464466 }
465467 data := in [0 ]
466468
467469 data .Name = dataVolumeName
470+
471+ if initPvc {
472+ // This can be set only when creating new PVC. It ensures that PVC can be
473+ // terminated after deleting parent MySQL cluster
474+ data .ObjectMeta .OwnerReferences = f .getOwnerReferences ()
475+ }
476+
468477 data .Spec = f .cluster .Spec .VolumeSpec .PersistentVolumeClaimSpec
469478
470479 in [0 ] = data
You can’t perform that action at this time.
0 commit comments