feat: add CDN redirect resolution to cgw strategy#91
Conversation
When a direct download from the content gateway returns HTML (the Developer Portal interstitial page) instead of a tar.gz, resolve the actual CDN download URL via ResolveCDNLink and retry. This enables CGW_URL to point to the Developer Portal file URL (e.g., developers.redhat.com/content-gateway/file/RHTAS/<version>) which is publicly accessible from any environment including Kind clusters in CI. Signed-off-by: Sachin Sampras M <sampras343@gmail.com>
PR Summary by QodoAdd CDN redirect resolution fallback to CGW CLI downloads
AI Description
Diagram
High-Level Assessment
Files changed (1)
|
Code Review by Qodo
1. Lost direct error
|
Summary
When the
cgwstrategy downloads a CLI binary from the Developer Portalfile/URL, the portal returns a 302 redirect to an HTML interstitial page — not the binary. This PR adds automatic CDN redirect resolution: if the direct download fails,ResolveCDNLinkextracts the actual CDN download URL from the redirect'stcDownloadURLquery parameter and retries.How it works
Why
With the cli-server being removed from the operator (securesign/secure-sign-operator#2143), the GitHub Actions Kind CI can no longer use
CLI_STRATEGY=cli_server. Thecgwstrategy with CDN resolution enables downloading CLI binaries from the publicly accessible Developer Portal.Verified
All
go test ./pkg/...pass.