@@ -437,15 +437,8 @@ func (b *DatabaseStatefulSetBuilder) buildContainer() corev1.Container {
437437 }
438438 }
439439
440- var grpcPublicPort int32
441- if b .Spec .Service .GRPC .ExternalPort != 0 {
442- grpcPublicPort = b .Spec .Service .GRPC .ExternalPort
443- } else {
444- grpcPublicPort = api .GRPCPort
445- }
446-
447440 ports := []corev1.ContainerPort {{
448- Name : "grpc" , ContainerPort : grpcPublicPort ,
441+ Name : "grpc" , ContainerPort : api . GRPCPort ,
449442 }, {
450443 Name : "interconnect" , ContainerPort : api .InterconnectPort ,
451444 }, {
@@ -655,12 +648,10 @@ func (b *DatabaseStatefulSetBuilder) buildContainerArgs() ([]string, []string) {
655648 publicHostOption := "--grpc-public-host"
656649 publicHostDomain := fmt .Sprintf (api .InterconnectServiceFQDNFormat , b .Database .Name , b .GetNamespace (), domain )
657650 publicHost := fmt .Sprintf ("%s.%s" , "$(POD_NAME)" , publicHostDomain )
651+
658652 if b .Spec .Service .GRPC .ExternalHost != "" {
659653 publicHost = fmt .Sprintf ("%s.%s" , "$(POD_NAME)" , b .Spec .Service .GRPC .ExternalHost )
660654 }
661- if b .Spec .Service .GRPC .ExternalPort > 0 {
662- publicHost = "$(NODE_NAME)"
663- }
664655 if value , ok := b .ObjectMeta .Annotations [api .AnnotationGRPCPublicHost ]; ok {
665656 publicHost = value
666657 }
@@ -690,10 +681,12 @@ func (b *DatabaseStatefulSetBuilder) buildContainerArgs() ([]string, []string) {
690681
691682 publicPortOption := "--grpc-public-port"
692683 publicPort := fmt .Sprintf ("%d" , api .GRPCPort )
693- if b .Spec .Service .GRPC .ExternalPort != 0 {
684+ if b .Spec .Service .GRPC .ExternalPort > 0 {
685+ publicHost = "$(NODE_NAME)"
694686 publicPort = fmt .Sprintf ("%d" , b .Spec .Service .GRPC .ExternalPort )
695687 }
696688 if value , ok := b .ObjectMeta .Annotations [api .AnnotationGRPCPublicPort ]; ok {
689+ publicHost = "$(NODE_NAME)"
697690 publicPort = value
698691 }
699692
0 commit comments