Skip to content

Conversation

gibmat
Copy link
Collaborator

@gibmat gibmat commented Sep 17, 2025

Add logic to uninstall an application, optionally also removing all relevant user data as well. Extends the /applications/{name} endpoint to accept a DELETE request to trigger the removal.

Comment on lines +185 to +202
// Remove the sysext image.
err = os.Remove("/var/lib/extensions/operations-center.raw")
if err != nil {
return err
}

// Refresh the system extensions.
err = systemd.RefreshExtensions(ctx)
if err != nil {
return err
}

// Reload the systemd daemon.
err = systemd.ReloadDaemon(ctx)
if err != nil {
return err
}

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Given the repetition, should we have a systemd.RemoveExtension or something which does those three steps?

@stgraber
Copy link
Member

I'm not sure what the use case for this is, at least for primary applications (incus, operations-center, migration-manager) as the moment you uninstall them, you've got a bricked system.

It makes sense for additional applications like debug or the openfga application, but not so much for the primary ones.

@gibmat gibmat closed this Sep 24, 2025
@gibmat gibmat deleted the uninstall-app branch October 1, 2025 15:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

2 participants