Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

scripts: fix empty-incus.sh instances delete #1222

Merged
merged 1 commit into from
Sep 15, 2024
Merged
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
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
Loading