@@ -632,15 +632,9 @@ func (b *DatabaseStatefulSetBuilder) buildContainerArgs() ([]string, []string) {
632632 }
633633 }
634634
635+ publicHostOption := "--grpc-public-host"
635636 publicHost := fmt .Sprintf (api .InterconnectServiceFQDNFormat , b .Database .Name , b .GetNamespace ()) // FIXME .svc.cluster.local
636637
637- if b .Spec .Service .GRPC .ExternalHost != "" {
638- publicHost = b .Spec .Service .GRPC .ExternalHost
639- }
640- if value , ok := b .ObjectMeta .Annotations [api .AnnotationGRPCPublicHost ]; ok {
641- publicHost = value
642- }
643-
644638 if b .Spec .Service .GRPC .IPDiscovery != nil && b .Spec .Service .GRPC .IPDiscovery .Enabled == true {
645639
646640 ipFamilyArg := "--grpc-public-address-v4"
@@ -658,19 +652,23 @@ func (b *DatabaseStatefulSetBuilder) buildContainerArgs() ([]string, []string) {
658652 "$(POD_IP)" ,
659653 )
660654 } else {
661- publicHostOption : = "--grpc-public-host"
662- args = append (
663- args ,
664- publicHostOption ,
665- fmt . Sprintf ( "%s.%s" , "$(NODE_NAME)" , publicHost ), // fixme $(NODE_NAME)
666- )
655+ if b . Spec . Service . GRPC . ExternalHost ! = "" {
656+ publicHost = b . Spec . Service . GRPC . ExternalHost
657+ }
658+ if value , ok := b . ObjectMeta . Annotations [ api . AnnotationGRPCPublicHost ]; ok {
659+ publicHost = value
660+ }
667661 }
668662
669663 publicPortOption := "--grpc-public-port"
670664 publicPort := api .GRPCPort
671665
672666 args = append (
673667 args ,
668+
669+ publicHostOption ,
670+ fmt .Sprintf ("%s.%s" , "$(NODE_NAME)" , publicHost ), // fixme $(NODE_NAME)
671+
674672 publicPortOption ,
675673 strconv .Itoa (publicPort ),
676674 )
0 commit comments