snapcraft validate does not work with snaps in stores other than Global
Bug #1902913 reported by
Natalia Bidart
This bug affects 1 person
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
Snapcraft |
Fix Released
|
High
|
Sergio Schvezov |
Bug Description
A customer is trying to issue a validation assertion using snapcraft, and one of the snaps being added as gated snap is not available in public searches.
So when running, for example, the following command:
nessita@dali:~$ snapcraft validate nessita-gating snapd=1255 caracalla-
Getting details for snapd
Signing validations assertion for snapd=1255
Getting details for caracalla-kernel
Snap 'caracalla-kernel' was not found.
Recommended resolution:
Ensure you have proper access rights for 'caracalla-kernel'.
I can't issue the validation though my account does have access to that snap.
Changed in snapcraft: | |
status: | In Progress → Fix Committed |
To post a comment you must log in.
After reviewing the snapcraft code, I believe this is a bug in the implementation of:
71 def get_info(self, snap_name: str, *, arch: str = None) -> SnapInfo:
This method is used to get the snap IDs for the given gated snap name, but it does not support getting information for snaps in stores other than Global (this bug report) and it also does not support getting info for snaps that were never released to stable (see LP: #1775658).
What I believe would a simple and doable fix is to allow the user to pass explicitly the snap IDs in the validate call so snapcraft does not need to search for the snap ID.