Skip to content

Commit

Permalink
Merge pull request #1222 from itviewer/main
Browse files Browse the repository at this point in the history
scripts: fix empty-incus.sh instances delete
  • Loading branch information
stgraber authored Sep 15, 2024
2 parents 7076330 + c3f84ed commit 282da2f
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions scripts/empty-incus.sh
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,9 @@ fi

## Delete anything that's tied to a project
for project in $(incus query "/1.0/projects?recursion=1" | jq .[].name -r); do
echo "==> Deleting all containers for project: ${project}"
for container in $(incus query "/1.0/containers?recursion=1&project=${project}" | jq .[].name -r); do
incus delete --project "${project}" -f "${container}"
echo "==> Deleting all instances for project: ${project}"
for instance in $(incus query "/1.0/instances?recursion=1&project=${project}" | jq .[].name -r); do
incus delete --project "${project}" -f "${instance}"
done

echo "==> Deleting all images for project: ${project}"
Expand Down

0 comments on commit 282da2f

Please sign in to comment.