Skip to content

Commit

Permalink
incusd/profiles: Empty default profile on forced deletion
Browse files Browse the repository at this point in the history
Signed-off-by: Stéphane Graber <stgraber@stgraber.org>
  • Loading branch information
stgraber committed Sep 3, 2024
1 parent 8032164 commit 802b7af
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions cmd/incusd/api_project.go
Original file line number Diff line number Diff line change
Expand Up @@ -1094,6 +1094,12 @@ func projectDelete(d *Daemon, r *http.Request) response.Response {
count--
}

// Empty the default profile.
err = target.UpdateProfile("default", api.ProfilePut{}, "")
if err != nil {
return response.InternalError(err)
}

// Delete images.
for _, imageFingerprint := range entries["images"] {
op, err := target.DeleteImage(imageFingerprint)
Expand Down

0 comments on commit 802b7af

Please sign in to comment.