Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 5 additions & 8 deletions internal/deployer/deploy_via_operator.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)

Expand All @@ -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
}
}

Expand All @@ -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
}
}

Expand Down Expand Up @@ -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"
}
Expand Down
8 changes: 3 additions & 5 deletions internal/deployer/deployer.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
Loading