diff --git a/pkg/operator/certrotationcontroller/externalloadbalancer.go b/pkg/operator/certrotationcontroller/externalloadbalancer.go index 81446a93df..1feabf67be 100644 --- a/pkg/operator/certrotationcontroller/externalloadbalancer.go +++ b/pkg/operator/certrotationcontroller/externalloadbalancer.go @@ -21,7 +21,8 @@ func (c *CertRotationController) syncExternalLoadBalancerHostnames() error { return nil } hostname = strings.Replace(hostname, "https://", "", 1) - hostname = hostname[0:strings.LastIndex(hostname, ":")] + hostname_arr := strings.Split(hostname, ":") + hostname = hostname_arr[0] klog.V(2).Infof("syncing external loadbalancer hostnames: %v", hostname) c.externalLoadBalancer.setHostnames([]string{hostname})