Skip to content

Commit 5ff396c

Browse files
author
smiletan
committed
fix pvc not created when first deployed
1 parent c2f7a87 commit 5ff396c

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)