Skip to content

Commit f28a774

Browse files
committed
Use internal API Server URL for internal load balancer
1 parent ed206b6 commit f28a774

File tree

3 files changed

+3
-4
lines changed

3 files changed

+3
-4
lines changed

pkg/operator/certrotationcontroller/externalloadbalancer.go

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,6 @@ func (c *CertRotationController) syncExternalLoadBalancerHostnames() error {
1818
hostname := infrastructureConfig.Status.APIServerURL
1919
hostname = strings.Replace(hostname, "https://", "", 1)
2020
hostname = hostname[0:strings.LastIndex(hostname, ":")]
21-
hostname = strings.Replace(hostname, "api-int.", "api.", 1)
2221

2322
klog.V(2).Infof("syncing external loadbalancer hostnames: %v", hostname)
2423
c.externalLoadBalancer.setHostnames([]string{hostname})

pkg/operator/certrotationcontroller/internalloadbalancer.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ func (c *CertRotationController) syncInternalLoadBalancerHostnames() error {
1515
if err != nil {
1616
return err
1717
}
18-
hostname := infrastructureConfig.Status.APIServerURL
18+
hostname := infrastructureConfig.Status.APIServerInternalURL
1919
hostname = strings.Replace(hostname, "https://", "", 1)
2020
hostname = hostname[0:strings.LastIndex(hostname, ":")]
2121

test/e2e/user_certs_test.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -305,7 +305,7 @@ func getExternalAPIServiceHostName(client *configclient.ConfigV1Client) (string,
305305
if err != nil {
306306
return "", err
307307
}
308-
return strings.Replace(strings.Split(apiServerURL.Host, ":")[0], "api-int.", "api.", 1), nil
308+
return strings.Split(apiServerURL.Host, ":")[0], nil
309309
}
310310

311311
func getInternalAPIServiceHostNameOrFail(t *testing.T, client *configclient.ConfigV1Client) string {
@@ -320,7 +320,7 @@ func getInternalAPIServiceHostName(client *configclient.ConfigV1Client) (string,
320320
if err != nil {
321321
return "", err
322322
}
323-
apiServerURL, err := url.Parse(infrastructure.Status.APIServerURL)
323+
apiServerURL, err := url.Parse(infrastructure.Status.APIServerInternalURL)
324324
if err != nil {
325325
return "", err
326326
}

0 commit comments

Comments
 (0)