diff --git a/Dockerfile b/Dockerfile index 1d5e612..c633aca 100644 --- a/Dockerfile +++ b/Dockerfile @@ -41,11 +41,18 @@ RUN \ ln -s /opt/kubevirt/virtctl /usr/local/bin/virtctl && \ # install kustomize ln -s /opt/kustomize/kustomize /usr/local/bin/kustomize && \ + # make the bare 'helm' command default to helm v4 (helm3/helm4 remain available explicitly) + # guard against a stale container-root tarball (rebuilt without ./build.sh -u), which would + # lack helm4 and still carry an old bare 'helm' binary, making the symlink fail confusingly + { test -x /usr/local/bin/helm4 || { echo "helm4 missing: please rebuild with ./build.sh -u" >&2; exit 1; }; } && \ + ln -s /usr/local/bin/helm4 /usr/local/bin/helm && \ # install bash completions kubectl completion bash > $COMPDIR/kubectl && \ oc completion bash > $COMPDIR/oc && \ kn completion bash > $COMPDIR/kn && \ helm completion bash > $COMPDIR/helm && \ + helm3 completion bash | sed 's/ helm$/ helm3/' > $COMPDIR/helm3 && \ + helm4 completion bash | sed 's/ helm$/ helm4/' > $COMPDIR/helm4 && \ tkn completion bash > $COMPDIR/tkn && \ virtctl completion bash > $COMPDIR/virtctl && \ rhoas completion bash > $COMPDIR/rhoas && \ diff --git a/README.md b/README.md index 241e72c..17afb30 100644 --- a/README.md +++ b/README.md @@ -7,7 +7,9 @@ Includes tools that enable a Kubernetes and OpenShift developer to interact with - [oc](https://github.com/openshift/origin) [v4.21.4](https://mirror.openshift.com/pub/openshift-v4/x86_64/clients/ocp/4.21.4/) - [kubectl](https://github.com/kubernetes/kubectl) [v1.34.4](https://mirror.openshift.com/pub/openshift-v4/x86_64/clients/ocp/4.21.4/) - [kustomize](https://github.com/kubernetes-sigs/kustomize) [v5.8.1](https://github.com/kubernetes-sigs/kustomize/tree/kustomize/v5.8.1) -- [helm](https://helm.sh/) [v3.17.1](https://mirror.openshift.com/pub/openshift-v4/x86_64/clients/helm/3.17.1) +- helm — available as both `helm3` and `helm4`; the bare `helm` command defaults to v4 + - [helm3](https://helm.sh/) [v3.22.0-90](https://mirror.openshift.com/pub/openshift-v4/x86_64/clients/helm/3.22.0-90) + - [helm4](https://helm.sh/) [v4.3.0](https://mirror.openshift.com/pub/openshift-v4/x86_64/clients/helm/4.3.0) - [tekton](https://github.com/tektoncd/cli) [v1.20.0](https://mirror.openshift.com/pub/openshift-v4/x86_64/clients/pipelines/1.20.0/) - [knative](https://github.com/knative/client) [v1.15.0-6](https://mirror.openshift.com/pub/openshift-v4/x86_64/clients/serverless/1.15.0-6/) - [rhoas](https://github.com/redhat-developer/app-services-cli) [v0.53.0](https://github.com/redhat-developer/app-services-cli/tree/v0.53.0) diff --git a/etc/get-tooling-versions.sh b/etc/get-tooling-versions.sh index 8acaff3..34c3cda 100755 --- a/etc/get-tooling-versions.sh +++ b/etc/get-tooling-versions.sh @@ -31,9 +31,14 @@ else append_ver "kustomize|${KUSTOMIZE_VER#v} |Kustomize CLI (built-in to kubectl)" fi -if command -v helm &>/dev/null; then - HELM_VER=$(helm version --short --template '{{.Version}}' 2>/dev/null | grep -Eo 'v?[0-9]+\.[0-9]+\.[0-9]+') - append_ver "helm |${HELM_VER#v} |Helm CLI" +if command -v helm3 &>/dev/null; then + HELM3_VER=$(helm3 version --short --template '{{.Version}}' 2>/dev/null | grep -Eo 'v?[0-9]+\.[0-9]+\.[0-9]+') + append_ver "helm3 |${HELM3_VER#v} |Helm CLI v3" +fi + +if command -v helm4 &>/dev/null; then + HELM4_VER=$(helm4 version --short --template '{{.Version}}' 2>/dev/null | grep -Eo 'v?[0-9]+\.[0-9]+\.[0-9]+') + append_ver "helm4 |${HELM4_VER#v} |Helm CLI v4 (default 'helm')" fi if command -v kn &>/dev/null; then diff --git a/get-sources.sh b/get-sources.sh index 26d947f..e16ef87 100755 --- a/get-sources.sh +++ b/get-sources.sh @@ -46,13 +46,22 @@ echo "Extracted kubectl ${KUBECTL_VER}" rm -rf "${TMPDIR:?}"/* -echo "Downloading helm ${HELM_VER}" -curl -sSfL --insecure --remote-name-all \ - "${OPENSHIFT_CLIENTS_URL}/helm/${HELM_VER}/sha256sum.txt" \ - "${OPENSHIFT_CLIENTS_URL}/helm/${HELM_VER}/helm-linux-amd64" -echo "$(grep helm-linux-amd64$ sha256sum.txt | cut -d' ' -f1) helm-linux-amd64" | sha256sum --check --status -mv helm-linux-amd64 "$CONTAINER_USR_BIN_DIR/helm" -rm -rf "${TMPDIR:?}"/* +# Install helm v3 and v4 side-by-side as 'helm3' and 'helm4'. The bare 'helm' +# command is symlinked to helm4 in the Dockerfile (helm v4 is the default as of +# OCP 5.0). Both versions are published on the mirror as tarballs that extract +# to a single 'helm-linux-amd64' binary. +for helm_entry in "helm3:${HELM3_VER}" "helm4:${HELM4_VER}"; do + helm_name="${helm_entry%%:*}" + helm_ver="${helm_entry##*:}" + echo "Downloading ${helm_name} ${helm_ver}" + curl -sSfL --insecure --remote-name-all \ + "${OPENSHIFT_CLIENTS_URL}/helm/${helm_ver}/sha256sum.txt" \ + "${OPENSHIFT_CLIENTS_URL}/helm/${helm_ver}/helm-linux-amd64.tar.gz" + echo "$(grep "helm-linux-amd64.tar.gz$" sha256sum.txt | cut -d' ' -f1) helm-linux-amd64.tar.gz" | sha256sum --check --status + tar xzf helm-linux-amd64.tar.gz + mv helm-linux-amd64 "$CONTAINER_USR_BIN_DIR/${helm_name}" + rm -rf "${TMPDIR:?}"/* +done echo "Downloading tekton ${TKN_VER}" curl -sSfL --insecure --remote-name-all \ @@ -112,7 +121,8 @@ rm -f rh-manifest.txt || true echo "oc ${OC_VER} ${OPENSHIFT_CLIENTS_URL}/ocp/${OC_VER}" echo "kubectl ${KUBECTL_VER} ${OPENSHIFT_CLIENTS_URL}/ocp/${OC_VER}" echo "kustomize ${KUSTOMIZE_VER} https://github.com/kubernetes-sigs/kustomize/tree/kustomize/v${KUSTOMIZE_VER}" - echo "helm ${HELM_VER} ${OPENSHIFT_CLIENTS_URL}/helm/${HELM_VER}" + echo "helm3 ${HELM3_VER} ${OPENSHIFT_CLIENTS_URL}/helm/${HELM3_VER}" + echo "helm4 ${HELM4_VER} ${OPENSHIFT_CLIENTS_URL}/helm/${HELM4_VER}" echo "tekton ${TKN_VER} ${OPENSHIFT_CLIENTS_URL}/pipelines/${TKN_VER}" echo "knative ${KN_VER} ${OPENSHIFT_CLIENTS_URL}/serverless/${KN_VER}" echo "rhoas ${RHOAS_VER} https://github.com/redhat-developer/app-services-cli/tree/v${RHOAS_VER}" diff --git a/rh-manifest.txt b/rh-manifest.txt index ac4c7b2..f367c96 100644 --- a/rh-manifest.txt +++ b/rh-manifest.txt @@ -1,7 +1,8 @@ oc 4.21.4 https://mirror.openshift.com/pub/openshift-v4/x86_64/clients/ocp/4.21.4/ kubectl https://mirror.openshift.com/pub/openshift-v4/x86_64/clients/ocp/4.21.4/ kustomize 5.8.1 https://github.com/kubernetes-sigs/kustomize/tree/kustomize/v5.8.1 -helm 3.17.1 https://mirror.openshift.com/pub/openshift-v4/x86_64/clients/helm/3.17.1 +helm3 3.22.0-90 https://mirror.openshift.com/pub/openshift-v4/x86_64/clients/helm/3.22.0-90 +helm4 4.3.0 https://mirror.openshift.com/pub/openshift-v4/x86_64/clients/helm/4.3.0 tekton 1.20.0 https://mirror.openshift.com/pub/openshift-v4/x86_64/clients/pipelines/1.20.0 knative 1.15.0-6 https://mirror.openshift.com/pub/openshift-v4/x86_64/clients/serverless/1.15.0-6 rhoas 0.53.0 https://github.com/redhat-developer/app-services-cli/tree/v0.53.0 diff --git a/tooling_versions.env b/tooling_versions.env index 05ee103..873f04a 100644 --- a/tooling_versions.env +++ b/tooling_versions.env @@ -1,6 +1,7 @@ OC_VER=4.21.4 KUSTOMIZE_VER=5.8.1 -HELM_VER=3.17.1 +HELM3_VER=3.22.0-90 +HELM4_VER=4.3.0 TKN_VER=1.20.0 KN_VER=1.15.0-6 RHOAS_VER=0.53.0