Skip to content

Instantly share code, notes, and snippets.

@jdolitsky
Created August 30, 2021 21:00
Show Gist options
  • Save jdolitsky/66e0768ceedb6eab7395422e86e16a53 to your computer and use it in GitHub Desktop.
Save jdolitsky/66e0768ceedb6eab7395422e86e16a53 to your computer and use it in GitHub Desktop.
Republish an old OCI-based chart using Helm 3.7+
# Temporarily install older version of Helm (3.6.3), enable OCI support
mkdir -p tmp/
curl https://raw.githubusercontent.com/helm/helm/master/scripts/get-helm-3 | \
DESIRED_VERSION="v3.6.3" USE_SUDO="false" HELM_INSTALL_DIR="${PWD}/tmp" bash
mv tmp/helm tmp/helm36
export PATH="${PWD}/tmp:${PATH}"
export HELM_EXPERIMENTAL_OCI=1
# Configure settings for old OCI chart
OCI_ROOT="bundle.bar/u/jdolitsky/demo/bitnami"
CHART_NAME="wordpress"
CHART_VERSION="10.0.6"
# Download and extract old version of OCI chart using old version of Helm
helm36 chart pull "${OCI_ROOT}/${CHART_NAME}:${CHART_VERSION}"
helm36 chart export "${OCI_ROOT}/${CHART_NAME}:${CHART_VERSION}"
# Package and push new OCI chart using Helm 3.7+
helm package "${CHART_NAME}/"
helm push "${CHART_NAME}-${CHART_VERSION}.tgz" "oci://${OCI_ROOT}"
@dancnfoo
Copy link

Once above script is run, is it replacing the chart of the same name and tag (and digest), or add a new entry?

If replacement, after the run, helm36 chart pull "${OCI_ROOT}/${CHART_NAME}:${CHART_VERSION}" would fail, correct?

@jdolitsky
Copy link
Author

@dancnfoo - it should be complete replacement.

I'm not sure if helm36 chart pull would fail or not... in any case it it not recommended. Let me what results you have if you try

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment