Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 8 additions & 1 deletion devstack/lib/commands.sh
Original file line number Diff line number Diff line change
Expand Up @@ -39,5 +39,12 @@ devstack_down() { # stop the shared ingress + the VM (GLOBAL — affects all pr
devstack_reset() { # GLOBAL destructive — wipes ALL projects' state
echo "WARNING: deletes the shared VM and ALL projects' data on it."
read -r -p "type the profile name to confirm: " c
[ "$c" = "$DEVSTACK_PROFILE" ] && colima delete -p "$DEVSTACK_PROFILE" -f || echo "aborted"
if [ "$c" != "$DEVSTACK_PROFILE" ]; then echo "aborted"; return; fi
colima delete -p "$DEVSTACK_PROFILE" -f
# colima/Lima keeps a persistent data disk under _lima/_disks/<instance> (bind-mounted
# to /var/lib/docker) that SURVIVES `colima delete`, so images, volumes and
# `restart: unless-stopped` containers resurrect on the next VM start. Remove it so
# reset is a true from-scratch wipe.
local inst="colima-$DEVSTACK_PROFILE"; [ "$DEVSTACK_PROFILE" = default ] && inst="colima"
rm -rf "$HOME/.colima/_lima/_disks/$inst"
}
9 changes: 8 additions & 1 deletion devstack/lib/verify.sh
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,14 @@ devstack_verify() {
linux)
getent hosts "$host" | grep -q '127.0.0.1' || { echo "DNS FAIL: $host !-> 127.0.0.1"; ok=0; } ;;
esac
nc -z -w2 127.0.0.1 443 || { echo "INGRESS FAIL: nothing on 127.0.0.1:443"; ok=0; }
# Traefik may have only just started (fresh image pull / cold boot); retry briefly so
# a not-yet-ready ingress doesn't spuriously fail the gate.
local i ingress=0
for i in $(seq 1 15); do
nc -z -w2 127.0.0.1 443 && { ingress=1; break; }
sleep 1
done
[ "$ingress" = 1 ] || { echo "INGRESS FAIL: nothing on 127.0.0.1:443 after retries"; ok=0; }
[ "$ok" = 1 ] && echo "devstack verify: OK ($host -> 127.0.0.1, Traefik :443 up)"
[ "$ok" = 1 ]
}
Loading