Skip to content

Commit ad05eb4

Browse files
committed
fix: some bugs
1 parent 44198f1 commit ad05eb4

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

internal/resources/storage_statefulset.go

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -358,8 +358,6 @@ func (b *StorageStatefulSetBuilder) buildCaStorePatchingInitContainerVolumeMount
358358

359359
func (b *StorageStatefulSetBuilder) buildContainerPorts() []corev1.ContainerPort {
360360
podPorts := []corev1.ContainerPort{{
361-
Name: "grpc", ContainerPort: api.GRPCPort,
362-
}, {
363361
Name: "interconnect", ContainerPort: api.InterconnectPort,
364362
}, {
365363
Name: "status", ContainerPort: api.StatusPort,
@@ -414,11 +412,16 @@ func (b *StorageStatefulSetBuilder) buildContainer() corev1.Container { // todo
414412
Resources: containerResources,
415413
}
416414

415+
livenessProbePort := api.GRPCPort
416+
if b.Spec.Service.GRPC.Port != 0 {
417+
livenessProbePort = int(b.Spec.Service.GRPC.Port)
418+
}
419+
417420
if value, ok := b.ObjectMeta.Annotations[api.AnnotationDisableLivenessProbe]; !ok || value != api.AnnotationValueTrue {
418421
container.LivenessProbe = &corev1.Probe{
419422
ProbeHandler: corev1.ProbeHandler{
420423
TCPSocket: &corev1.TCPSocketAction{
421-
Port: intstr.FromInt(api.GRPCPort),
424+
Port: intstr.FromInt(livenessProbePort),
422425
},
423426
},
424427
}

0 commit comments

Comments
 (0)