jnsgruk / concierge

An opinionated utility for provisioning charm development and testing machines.
Apache License 2.0
5 stars 2 forks source link

Concierge restore removes snaps that it did not install #22

Open gruyaume opened 1 week ago

gruyaume commented 1 week ago

Description

Concierge's documentation claims that concierge restore will restore the machine to it's pre-provisioned state. However, it deletes snaps that were installed on the machine prior to concierge installing them.

For example, if the jq snap was installed prior to running concierge prepare, concierge restore will delete the snap regardless of that fact.

To reproduce

  1. snap install jq
  2. jq
  3. sudo concierge prepare -p microk8s --microk8s-channel=1.31-strict/stable --lxd-channel "5.21/stable" --verbose
  4. sudo concierge restore
  5. jq

Expected behavior

concierge restore restores the machine to it's pre-provisioned state.

Environment

jnsgruk commented 1 week ago

Yes, the assumption with concierge has thus far been that it will be run on a pristine test machine.

I don't think it would be a big job to change this behaviour though. It probably just involves an extra check when building the Plan to not include snaps that are already installed.