Possible to undo "ignore-validation" refresh?

Hello there,

Is it possible to “undo” an action like this:

snap refresh --ignore-validation $SNAP_NAME

I tried by rerunning

snap validate --enforce --refresh $VALIDATION_SET

And even by changing the validation-set to a different sequence. Both keep the refreshed snap at their last version.

I would like to “undo” the --ignore-validation flag.

Using snapd 2.63 on an Ubuntu Core 22 device

@ogra do you have an idea?

You just need to refresh back to the revision that’s specified in the validation set. If the channel your device is tracking still has the newer revision published, then you can use --revision to refresh to the older (valid) revision. Ex.

snap refresh --revision $VALID_REVISION $SNAP_NAME

This should bring your device back into compliance.

And actually, you don’t really need the --revision, if you re-run snap refresh $SNAP_NAME, then snapd will trigger a refresh to the revision specified in the validation-set.

Note – this currently only works for required snaps in validation sets. There’s a bug with optional snaps which is currently being worked on.

You are totally right.

I had tried to do a “general snap refresh” but not one for a specific snap. Indeed, this reverts the snap to the one listed in the validation-set. Thanks a lot!