Skip to content

Commit

Permalink
us mc instead of curl for readiness check
Browse files Browse the repository at this point in the history
  • Loading branch information
Craig O'Donnell committed Nov 14, 2023
1 parent 193d3d6 commit f34be34
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions pkg/kotsadm/objects/scripts/import-minio-data.sh
Original file line number Diff line number Diff line change
Expand Up @@ -36,12 +36,6 @@ echo "starting new minio instance"
/bin/sh -ce "/usr/bin/docker-entrypoint.sh minio -C /home/minio/.minio/ server /export" &
MINIO_PID=$!

# wait for minio to be ready
until curl -s $KOTSADM_MINIO_ENDPOINT/minio/health/ready; do
echo "waiting for minio to be ready"
sleep 1
done

# alias the minio instance
echo "aliasing minio instance"
until $KOTSADM_MINIO_MIGRATION_DIR/bin/mc alias set $KOTSADM_MINIO_NEW_ALIAS $KOTSADM_MINIO_ENDPOINT $MINIO_ACCESS_KEY $MINIO_SECRET_KEY; do
Expand All @@ -50,6 +44,12 @@ until $KOTSADM_MINIO_MIGRATION_DIR/bin/mc alias set $KOTSADM_MINIO_NEW_ALIAS $KO
sleep 1
done

# wait for minio to be ready
until $KOTSADM_MINIO_MIGRATION_DIR/bin/mc ready $KOTSADM_MINIO_NEW_ALIAS; do
echo "waiting for minio to be ready"
sleep 1
done

# check if the bucket already exists
if $KOTSADM_MINIO_MIGRATION_DIR/bin/mc ls $KOTSADM_MINIO_NEW_ALIAS | grep -q $KOTSADM_MINIO_BUCKET_NAME; then
echo "bucket already exists, skipping creation"
Expand Down

0 comments on commit f34be34

Please sign in to comment.