Skip to content

Commit

Permalink
Support oci reference in source registry (#34) (#35)
Browse files Browse the repository at this point in the history
  • Loading branch information
ipetrov117 authored Oct 22, 2024
1 parent b30788d commit 32decc1
Showing 1 changed file with 9 additions and 4 deletions.
13 changes: 9 additions & 4 deletions scripts/day2/edge-save-oci-artefacts.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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."
Expand All @@ -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}

0 comments on commit 32decc1

Please sign in to comment.