From 32decc1cf6a2a5157371864845a0953620707cfd Mon Sep 17 00:00:00 2001 From: Ivo Petrov Date: Tue, 22 Oct 2024 14:44:19 +0300 Subject: [PATCH] Support oci reference in source registry (#34) (#35) --- scripts/day2/edge-save-oci-artefacts.sh | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/scripts/day2/edge-save-oci-artefacts.sh b/scripts/day2/edge-save-oci-artefacts.sh index ab93e27..6eaee56 100644 --- a/scripts/day2/edge-save-oci-artefacts.sh +++ b/scripts/day2/edge-save-oci-artefacts.sh @@ -51,9 +51,14 @@ if [[ -z "${source_registry}" ]]; then exit 1 fi -if [ ! -z "${source_registry}" ]; then - source_registry="${source_registry}/" -fi +case "${source_registry}" in + oci://*) + source_registry="${source_registry}/" + ;; + *) + source_registry="oci://${source_registry}/" + ;; +esac if ! command -v "helm" &> /dev/null; then echo "Script requires 'helm' to load images into the target registry." @@ -75,7 +80,7 @@ while IFS= read -r i; do continue fi - helm pull oci://${source_registry}${arrI[0]} --version ${arrI[1]} --destination ${temp_dir} + helm pull ${source_registry}${arrI[0]} --version ${arrI[1]} --destination ${temp_dir} done < "${list}" tar -czvf ${oci_archive} ${temp_dir}