diff --git a/internal/deployer/deploy_via_operator.go b/internal/deployer/deploy_via_operator.go index 3fc4790d..0d8f06b8 100644 --- a/internal/deployer/deploy_via_operator.go +++ b/internal/deployer/deploy_via_operator.go @@ -504,7 +504,8 @@ func (d *Deployer) checkPodProgress(ctx context.Context, seenPods map[string]str d.checkPodProgressInNamespace(ctx, d.centralNamespace, seenPods) } -// waitForLoadBalancer waits for a LoadBalancer service to get an external IP +// waitForLoadBalancer waits for a LoadBalancer service to get an external IP. +// Returns the endpoint as "host:port", with no https:// prefix. func (d *Deployer) waitForLoadBalancer(ctx context.Context, namespace, serviceName string, timeout int) (string, error) { d.logger.Infof("⏳ Waiting for LoadBalancer %s to get external IP...", serviceName) @@ -521,7 +522,7 @@ func (d *Deployer) waitForLoadBalancer(ctx context.Context, namespace, serviceNa } else { d.logger.Success("✓ LoadBalancer IP") } - return fmt.Sprintf("https://%s:443", ip), nil + return fmt.Sprintf("%s:443", ip), nil } } @@ -537,7 +538,7 @@ func (d *Deployer) waitForLoadBalancer(ctx context.Context, namespace, serviceNa } else { d.logger.Success("✓ LoadBalancer hostname") } - return fmt.Sprintf("https://%s:443", hostname), nil + return fmt.Sprintf("%s:443", hostname), nil } } @@ -613,11 +614,7 @@ func (d *Deployer) configureCentralEndpoint(ctx context.Context, exposure string if err != nil { return fmt.Errorf("failed to get LoadBalancer endpoint: %w", err) } - // Remove https:// prefix if present (waitForLoadBalancer returns https://ip:443) - // TODO(ROX-34499): This is silly, why add these affixes there, and then strip here?! - d.centralEndpoint = strings.TrimPrefix(endpoint, "https://") - d.centralEndpoint = strings.TrimSuffix(d.centralEndpoint, ":443") - d.centralEndpoint = d.centralEndpoint + ":443" + d.centralEndpoint = endpoint } else { d.centralEndpoint = "central." + centralNamespace + ".svc:443" } diff --git a/internal/deployer/deployer.go b/internal/deployer/deployer.go index c922146e..86573d86 100644 --- a/internal/deployer/deployer.go +++ b/internal/deployer/deployer.go @@ -1093,12 +1093,10 @@ func (d *Deployer) cleanupTempDir(path string, description string) { } func (d *Deployer) writeEnvrcFile(ctx context.Context, exposure string, portForwardWanted bool) error { - endpoint := strings.TrimPrefix(d.centralEndpoint, "https://") - var content strings.Builder - fmt.Fprintf(&content, "export API_ENDPOINT=%q\n", endpoint) - fmt.Fprintf(&content, "export ROX_ENDPOINT=%q\n", endpoint) - fmt.Fprintf(&content, "export ROX_BASE_URL='https://%s'\n", endpoint) + fmt.Fprintf(&content, "export API_ENDPOINT=%q\n", d.centralEndpoint) + fmt.Fprintf(&content, "export ROX_ENDPOINT=%q\n", d.centralEndpoint) + fmt.Fprintf(&content, "export ROX_BASE_URL='https://%s'\n", d.centralEndpoint) fmt.Fprintf(&content, "export ROX_USERNAME=%q\n", AdminUsername) fmt.Fprintf(&content, "export ROX_ADMIN_PASSWORD=%q\n", d.centralPassword) fmt.Fprintf(&content, "export ROX_CA_CERT_FILE=%q\n", d.roxCACertFile)