Skip to content

fix: simplify download fallback and fix resource leaks#90

Merged
sampras343 merged 2 commits into
mainfrom
SECURESIGN-2158-simplify-fallback
Jul 21, 2026
Merged

fix: simplify download fallback and fix resource leaks#90
sampras343 merged 2 commits into
mainfrom
SECURESIGN-2158-simplify-fallback

Conversation

@sampras343

@sampras343 sampras343 commented Jul 20, 2026

Copy link
Copy Markdown
Member

Summary

Simplify the openshift strategy download fallback and fix several resource leaks found during audit.

Fallback chain (simplified)

Tier Source When
1 Production developers.redhat.com/.../RHTAS/<current-version>/... Post-release
2 CDN fallback via developers.redhat.com/.../RHTAS/1.4.2/... redirect resolution Pre-release or current version unavailable

Removed

  • Staging Developer Portal fallback (developers.qa.redhat.com) — not accessible outside RH VPN
  • Squid proxy configuration (proxyForStagingOnly, stagingProxySuffixes)

Bug fixes

ID Fix File
C1 Fix goroutine + pipe reader leak on failed downloads testSupport.godefer pr.Close()
C3 Clean up temp directories on download failure openshift.goos.RemoveAll(tmp)
M1 Add bare cgwName as FindBinary candidate cgw.go — handles gitsign_cli, rekor_cli
M4 Retry body-read errors during download testSupport.go — explicit resp.Body.Close()

Verified

  • All go test ./pkg/... pass
  • All 8 CLIs verified against CDN archives from 1.4.1

Implements SECURESIGN-2158

Simplify the openshift strategy to a two-tier fallback:
1. Current version from ConsoleCLIDownload CR (production)
2. Stable version (1.4.2) via CDN redirect resolution

Remove all staging Developer Portal references and squid proxy
configuration — preprod instances are not accessible outside the
Red Hat VPN.

Additional fixes from audit:
- Fix goroutine/pipe reader leak on failed downloads (defer pr.Close)
- Clean up temp directories on download failure (os.RemoveAll)
- Add bare cgwName as FindBinary candidate for CLIs where
  cliName differs from cgwName (gitsign, rekor-cli)
- Retry body-read errors during download instead of failing
  immediately

Implements SECURESIGN-2158

Signed-off-by: Sachin Sampras M <sampras343@gmail.com>
Implements SECURESIGN-2158

Signed-off-by: Sachin Sampras M <sampras343@gmail.com>
@sampras343
sampras343 merged commit 2c1227e into main Jul 21, 2026
6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants