Skip to content

Commit dfc44ed

Browse files
committed
also set --grpc-public-host
1 parent 50f3618 commit dfc44ed

File tree

1 file changed

+11
-13
lines changed

1 file changed

+11
-13
lines changed

internal/resources/database_statefulset.go

Lines changed: 11 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -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

Comments
 (0)