Skip to content

Commit bec13e6

Browse files
author
smiletan
authored
Merge pull request #410 from intelligentfu8/fix-create-pvc-nocreate
[Bug]fix pvc not created when first deployed
2 parents c2f7a87 + 5ff396c commit bec13e6

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

pkg/controller/sub_controller/sub_controller.go

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -358,7 +358,10 @@ func (d *SubDefaultController) RestrictConditionsEqual(nst *appv1.StatefulSet, e
358358
//shield persistent volume update when the pvcProvider=Operator
359359
//in webhook should intercept the volume spec updated when use statefulset pvc.
360360
// TODO: updates to statefulset spec for fields other than 'replicas', 'template', 'updateStrategy', 'persistentVolumeClaimRetentionPolicy' and 'minReadySeconds' are forbidden
361-
nst.Spec.VolumeClaimTemplates = est.Spec.VolumeClaimTemplates
361+
//if create est vct is empty, should not assign to new st.
362+
if len(est.Spec.VolumeClaimTemplates) !=0 {
363+
nst.Spec.VolumeClaimTemplates = est.Spec.VolumeClaimTemplates
364+
}
362365
}
363366

364367
// PrepareReconcileResources prepare resource for reconcile

0 commit comments

Comments
 (0)