Snaps supplied by juju resource are installed in dangerous mode

Bug #1857066 reported by Vern Hart
14
This bug affects 2 people
Affects Status Importance Assigned to Milestone
Snap Layer
Triaged
Medium
Unassigned

Bug Description

When a charm that uses the snap layer, we can easily supply the snap via juju resource. This is useful for offline deployments but can be useful for other scenarios.

For example:

    juju deploy graylog --resource core=core_8213.snap --resource graylog=graylog_20.snap

When the charm installs the snap, it doesn't have access to the assert file so cannot verify the install. Because of this, the charm (using the snap layer) will install the snap with --dangerous.

This means the snap won't refresh to newer versions, if they happen to be available, and the rev of the snap will always be x1 or x2, etc.

https://pastebin.ubuntu.com/p/bmqypsCQ2J/

I propose the snap layer check for the existence of an asset resource for each snap and, if it exists, do a snap ack with that before installing the snap. If the asset resource doesn't exist, install the snap with --dangerous, just like before (maybe with a warning in a log file somewhere). This would allow refresh to work, the rev will be correct, and won't break existing charms that use the snap layer.

Revision history for this message
Stuart Bishop (stub) wrote :

Agreed

Changed in layer-snap:
status: New → Triaged
importance: Undecided → Medium
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.