Snaps supplied by juju resource are installed in dangerous mode
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=
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:/
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.
Agreed