snap: make `snap prepare-image` read .assert files for local snaps #3241

Closed
wants to merge 8 commits into
from

Conversation

Projects
None yet
4 participants
Collaborator

mvo5 commented Apr 26, 2017

This branch makes use of local .assert files when the --extra-snaps option is used. This allows us to have local snaps to behave like store snaps.

The only missing piece of information is the contact information of a local snap as this is coming from the store without any assertion.

If the approach looks reasonable I will tidy up and add proper tests.

mvo5 and others added some commits Apr 26, 2017

Merge pull request #16 from fgimenez/prepare-image-assert-test
tests: add spread test for assertions in prepare-image's extra-snaps
+ if err != nil {
+ return nil, err
+ }
+ if sr, ok := a.(*asserts.SnapRevision); ok {
@zyga

zyga Apr 27, 2017

Contributor

Do we need other assertions? (publisher and stuff)?

@mvo5

mvo5 Apr 27, 2017

Collaborator

It all happens later, there is assertion checking taking place already, we just need to fill in the right data so that the later code can verify them. The comment above tries to convey that.

@zyga

zyga Apr 28, 2017

Contributor

Later as in later when you are online or when some other process re-processes the same assertion files?

+ // assertion and set info accordingly. no need to
+ // actually check the assertion because we do that
+ // anyway for all snaps that have a snapID/revision.
+ f, err := os.Open(assertFile)
@pedronis

pedronis Apr 28, 2017

Contributor

I think the comment should also clarify that we will fetch the assertion again from the store, this is not making the process offline-friendly, just anchoring it

Collaborator

mvo5 commented May 2, 2017

Closing in favor of #3263

@mvo5 mvo5 closed this May 2, 2017

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment