Skip to content

Commit

Permalink
Use IMAGE_SRC
Browse files Browse the repository at this point in the history
  • Loading branch information
raoulh committed Dec 14, 2023
1 parent cecc07a commit 2d5c0e1
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 28 deletions.
4 changes: 2 additions & 2 deletions scripts/config_calaos-boot
Original file line number Diff line number Diff line change
Expand Up @@ -43,10 +43,10 @@ echo
source_files=(/usr/share/calaos/*.source)

for source_file in "${source_files[@]}"; do
image_src=$(<"$source_file")
source "$source_file"
ct_name=$(basename "$source_file" .source)

load_containers_cache "$ct_name" "$image_src"
load_containers_cache "$ct_name" "${IMAGE_SRC}"
done

echo
Expand Down
13 changes: 0 additions & 13 deletions scripts/load_containers_cache
Original file line number Diff line number Diff line change
Expand Up @@ -29,19 +29,6 @@ then

echo "Image : $image"

image_name=$(echo "$image" | cut -d ':' -f 1)
image_version=$(echo "$image" | cut -d ':' -f 2)

# Get SHA of image loaded
sha=$(podman images -a | grep "$image_name" | grep "$image_version" | awk -F ' ' '{ print $3 }')
echo "SHA : $sha"

# tag SHA with the full qualified image name
podman image tag "$sha" "$image"

# tag image to :latest
podman image tag "$sha" "$image_name":latest

# Remove the cache
rm -rf "$cache"
fi
16 changes: 3 additions & 13 deletions scripts/pull_calaos_image
Original file line number Diff line number Diff line change
Expand Up @@ -22,20 +22,10 @@ if [ ! -f "$url" ]; then
fi

# Read the URL from the source file
image_url=$(cat "$url")
source "$url"

echo " > Pulling image $image_url"
podman pull "$image_url"

# get image name and version
image_name=$(echo "$image_url" | cut -d ':' -f 1)
image_version=$(echo "$image_url" | cut -d ':' -f 2)

#get sha of image from podman
sha=$(podman images -a | grep "$image_name" | grep "$image_version" | awk -F ' ' '{ print $3 }')

# tag latest
podman image tag "$sha" "$image_name":latest
echo " > Pulling image $IMAGE_SRC"
podman pull "$IMAGE_SRC"

# Clean old remaining container images
echo " > Cleaning old images"
Expand Down

0 comments on commit 2d5c0e1

Please sign in to comment.