#!/bin/bash

# Load images into Kind cluster
echo "Loading images into Kind cluster..."

# Get the list of images from the local registry
IMAGES=$(docker images --format "table {{.Repository}}:{{.Tag}}" | grep localhost:5000 | grep -v "<none>" | tail -n +2)

for image in $IMAGES; do
    echo "Loading image: $image"
    kind load docker-image "$image" --name bakery-ia-local
    if [ $? -ne 0 ]; then
        echo "Failed to load image: $image"
    fi
done

echo "Done loading images to Kind cluster"