-
Notifications
You must be signed in to change notification settings - Fork 11
refactor(build): install Helm from CGW mirror instead of vendoring source #284
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
14 commits
Select commit
Hold shift + click to select a range
2606fc1
refactor(build): install Helm from CGW mirror instead of vendoring so…
rhdh-bot b8bea80
docs: document helm-lockfile-update target in CLAUDE.md
rhdh-bot 83caa86
refactor(build): helm-builder stage with OS/arch platform detection
rhdh-bot 512642e
feat(build): fall back to vendored helm when CGW mirror lacks version
rhdh-bot 83b30fa
refactor(build): rename helm scripts and document Stage 2a/2b swap
rhdh-bot f7ec7fc
docs(makefile): document CGW vs vendored helm version bump paths
rhdh-bot 85b7212
fix(helm): extract CGW flat tarball layout (helm-linux-amd64)
rhdh-bot bb2e0e8
fix(makefile): define OS/ARCH before HELM_ARCHIVE_DIR
rhdh-bot 98b0533
fix(e2e): resolve RHDH chart from Quay OCI on all branches
rhdh-bot 7455a6e
fix(e2e): use HELM_CHART_OCI_REF in test-utils to satisfy ShellCheck
rhdh-bot 7324927
fix(e2e): support 2.x chart values and pod-state wait on CI
rhdh-bot bbd0fa4
fix(e2e): strip Helm 4 OCI pull lines before kubectl apply
rhdh-bot ac0f36e
fix(build): verify Helm tarballs and harden install/E2E helpers
rhdh-bot 8557526
fix(build): drop coreutils from helm-builder install
rhdh-bot File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,10 @@ | ||
| --- | ||
| metadata: | ||
| version: "1.0" | ||
| artifacts: | ||
| - download_url: https://mirror.openshift.com/pub/cgw/helm/4.2.3/helm-linux-amd64.tar.gz | ||
| checksum: sha256:2e6ce9696a806be8f33ff538018a29e318b9409d46adac30089c0e07f70488ac | ||
| filename: helm-linux-amd64.tar.gz | ||
| - download_url: https://mirror.openshift.com/pub/cgw/helm/4.2.3/helm-linux-arm64.tar.gz | ||
| checksum: sha256:b1d40f3ee91ed837c46281e66001fdc16cc7ca96c9a232d809a787438c08fe19 | ||
| filename: helm-linux-arm64.tar.gz |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,47 @@ | ||
| #!/usr/bin/env bash | ||
| # | ||
| # Return 0 when Helm CGW mirror artifacts exist for the requested scope. | ||
| # | ||
| # Usage: | ||
| # hack/check-helm-binary-available.sh <version> # linux amd64 + arm64 (Konflux lockfile) | ||
| # hack/check-helm-binary-available.sh <version> <os> <arch> # single platform tarball (local Makefile) | ||
| # | ||
| # Examples: | ||
| # hack/check-helm-binary-available.sh 4.2.3 | ||
| # hack/check-helm-binary-available.sh 4.2.3 darwin arm64 | ||
|
|
||
| set -euo pipefail | ||
|
|
||
| if [[ $# -lt 1 || $# -gt 3 ]]; then | ||
| sed -n '2,/^$/s/^# \{0,1\}//p' "$0" | ||
| exit 2 | ||
| fi | ||
|
|
||
| VERSION="${1#v}" | ||
| BASE_URL="https://mirror.openshift.com/pub/cgw/helm/${VERSION}" | ||
|
|
||
| if ! command -v curl &>/dev/null; then | ||
| echo "Error: curl is required" >&2 | ||
| exit 2 | ||
| fi | ||
|
|
||
| tarball_exists() { | ||
| local os="$1" arch="$2" | ||
| local url="${BASE_URL}/helm-${os}-${arch}.tar.gz" | ||
| local code | ||
| code="$(curl -fsIL -o /dev/null -w '%{http_code}' "${url}" 2>/dev/null || true)" | ||
| [[ "${code}" == "200" ]] | ||
| } | ||
|
|
||
| if [[ $# -eq 3 ]]; then | ||
| tarball_exists "$2" "$3" | ||
| exit $? | ||
| fi | ||
|
|
||
| checksums="$(curl -fsSL "${BASE_URL}/sha256sum.txt" 2>/dev/null || true)" | ||
| if [[ -z "${checksums}" ]]; then | ||
| exit 1 | ||
| fi | ||
|
|
||
| grep -q ' helm-linux-amd64.tar.gz$' <<< "${checksums}" \ | ||
| && grep -q ' helm-linux-arm64.tar.gz$' <<< "${checksums}" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,87 @@ | ||
| #!/usr/bin/env bash | ||
| # | ||
| # Install helm from a Red Hat CGW mirror binary tarball to /tmp/helm. | ||
| # | ||
| # Curl mode (upstream Containerfile helm-builder): | ||
| # HELM_VERSION=4.2.3 CONTAINER_BUILD=true TARGETPLATFORM=linux/arm64 \ | ||
| # hack/install-helm-binary.sh | ||
| # | ||
| # Prefetch mode (Konflux hermetic helm-builder): | ||
| # CONTAINER_BUILD=true TARGETPLATFORM=linux/arm64 \ | ||
| # hack/install-helm-binary.sh --prefetch | ||
| # | ||
| # Local Makefile uses OS/ARCH from the host (darwin or linux) without CONTAINER_BUILD. | ||
|
|
||
| set -euo pipefail | ||
|
|
||
| PREFETCH=false | ||
| if [[ "${1:-}" == "--prefetch" ]]; then | ||
| PREFETCH=true | ||
| fi | ||
|
|
||
| if [[ -n "${TARGETPLATFORM:-}" ]]; then | ||
| # Use field 2 so linux/arm64/v8 (BuildKit) yields arm64, not v8. | ||
| BUILD_OS="${TARGETPLATFORM%%/*}" | ||
| BUILD_ARCH="$(cut -d/ -f2 <<< "${TARGETPLATFORM}")" | ||
| else | ||
| BUILD_OS=$(uname -s | tr '[:upper:]' '[:lower:]') | ||
| case "$(uname -m)" in | ||
| x86_64) BUILD_ARCH=amd64 ;; | ||
| aarch64|arm64) BUILD_ARCH=arm64 ;; | ||
| *) echo "unsupported arch: $(uname -m)" >&2; exit 1 ;; | ||
| esac | ||
| fi | ||
|
|
||
| if [[ "${CONTAINER_BUILD:-}" == "true" ]]; then | ||
| case "${BUILD_OS}" in | ||
| linux) ;; | ||
| *) echo "unsupported OS for container image: ${BUILD_OS} (expected linux)" >&2; exit 1 ;; | ||
| esac | ||
| fi | ||
|
|
||
| case "${BUILD_ARCH}" in | ||
| amd64|arm64) ;; | ||
| *) echo "unsupported arch: ${BUILD_ARCH}" >&2; exit 1 ;; | ||
| esac | ||
|
|
||
| TARBALL="helm-${BUILD_OS}-${BUILD_ARCH}.tar.gz" | ||
| MEMBER="helm-${BUILD_OS}-${BUILD_ARCH}" | ||
|
|
||
| extract_helm() { | ||
| local archive="$1" | ||
| tar xzf "${archive}" -C /tmp "${MEMBER}" | ||
| mv "/tmp/${MEMBER}" /tmp/helm | ||
| } | ||
|
|
||
| SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)" | ||
| VERIFY_SCRIPT="${VERIFY_SCRIPT:-${SCRIPT_DIR}/verify-helm-tarball.sh}" | ||
|
|
||
| if ${PREFETCH}; then | ||
| # shellcheck disable=SC1091 | ||
| . /cachi2/cachi2.env | ||
| extract_helm "/cachi2/output/deps/generic/${TARBALL}" | ||
| else | ||
| if [[ -z "${HELM_VERSION:-}" ]]; then | ||
| echo "HELM_VERSION is required for curl mode" >&2 | ||
| exit 1 | ||
| fi | ||
| curl -fsSL "https://mirror.openshift.com/pub/cgw/helm/${HELM_VERSION}/${TARBALL}" \ | ||
| -o "/tmp/${TARBALL}" | ||
| if [[ -z "${LOCKFILE:-}" ]]; then | ||
| if [[ -f "${SCRIPT_DIR}/artifacts.lock.yaml" ]]; then | ||
| LOCKFILE="${SCRIPT_DIR}/artifacts.lock.yaml" | ||
| else | ||
| LOCKFILE="${SCRIPT_DIR}/../artifacts.lock.yaml" | ||
| fi | ||
| fi | ||
| if [[ ! -f "${VERIFY_SCRIPT}" ]]; then | ||
| echo "Error: verify script not found: ${VERIFY_SCRIPT}" >&2 | ||
| exit 1 | ||
| fi | ||
| bash "${VERIFY_SCRIPT}" "/tmp/${TARBALL}" "${TARBALL}" "${LOCKFILE}" "${HELM_VERSION}" | ||
| extract_helm "/tmp/${TARBALL}" | ||
| rm -f "/tmp/${TARBALL}" | ||
|
nickboldt marked this conversation as resolved.
|
||
| fi | ||
|
|
||
| chmod +x /tmp/helm | ||
| /tmp/helm version | ||
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.