From 22684454080a45939af825f53aa051d81ac04eb1 Mon Sep 17 00:00:00 2001 From: David Newman Date: Fri, 16 Dec 2022 15:31:08 +1000 Subject: [PATCH] Set the APIURLOverride with the internal API URL (#2603) --- pkg/hive/install.go | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/pkg/hive/install.go b/pkg/hive/install.go index defb96e4d..5105514e3 100644 --- a/pkg/hive/install.go +++ b/pkg/hive/install.go @@ -6,10 +6,12 @@ package hive import ( "context" "encoding/json" + "fmt" "os" "path" "path/filepath" "runtime" + "strings" hivev1 "github.com/openshift/hive/apis/hive/v1" hivev1azure "github.com/openshift/hive/apis/hive/v1/azure" @@ -167,6 +169,11 @@ func (c *clusterManager) clusterDeploymentForInstall(doc *api.OpenShiftClusterDo } } + clusterDomain := doc.OpenShiftCluster.Properties.ClusterProfile.Domain + if !strings.ContainsRune(clusterDomain, '.') { + clusterDomain += "." + os.Getenv("DOMAIN_NAME") + } + // Do not set InfraID here, as Hive wants to do that return &hivev1.ClusterDeployment{ ObjectMeta: metav1.ObjectMeta{ @@ -195,6 +202,7 @@ func (c *clusterManager) clusterDeploymentForInstall(doc *api.OpenShiftClusterDo }, ControlPlaneConfig: hivev1.ControlPlaneConfigSpec{ APIServerIPOverride: doc.OpenShiftCluster.Properties.NetworkProfile.APIServerPrivateEndpointIP, + APIURLOverride: fmt.Sprintf("api-int.%s:6443", clusterDomain), }, PullSecretRef: &corev1.LocalObjectReference{ Name: pullsecretSecretName,