-
Notifications
You must be signed in to change notification settings - Fork 587
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
o/snapstate, overlord, o/devicestate: support downloading components in snapstate.Download #14835
o/snapstate, overlord, o/devicestate: support downloading components in snapstate.Download #14835
Conversation
88f3b2d
to
8b8a47e
Compare
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #14835 +/- ##
==========================================
+ Coverage 78.20% 78.27% +0.06%
==========================================
Files 1151 1153 +2
Lines 151396 152219 +823
==========================================
+ Hits 118402 119152 +750
- Misses 25662 25706 +44
- Partials 7332 7361 +29
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
thanks, did a pass, some comments
overlord/snapstate/snapmgr.go
Outdated
@@ -245,6 +248,26 @@ func (compsu *ComponentSetup) Revision() snap.Revision { | |||
return compsu.CompSideInfo.Revision | |||
} | |||
|
|||
func (compsu *ComponentSetup) MountFile(instanceName string) string { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this needs a doc comment, also it's slightly strange name for this given that it takes into account a variable BlobDir, this is the mount file only if DownloadBlobDir is unset
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is symmetric with the MountFile method on SnapSetup. Maybe they both could be renamed? SourceFile
? BlobPath
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Renamed.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
thank you
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, thanks!
overlord/snapstate/snapmgr.go
Outdated
@@ -197,8 +197,10 @@ func (snapsup *SnapSetup) MountDir() string { | |||
return snap.MountDir(snapsup.InstanceName(), snapsup.Revision()) | |||
} | |||
|
|||
// MountFile returns the path to the snap/squashfs file that is used to mount the snap. | |||
func (snapsup *SnapSetup) MountFile() string { | |||
// BlobPath returns the path to the snap/squashfs file that is backs the snap |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
typo: s/is //
…in snapstate.Download
…gainst validation sets
…ponent}Setup.MountFile to BlobPath
c206dcd
to
6b29345
Compare
Only required failure is |
This will enable us to download arbitrary components for the purpose of creating a recovery system. Follow-up PR will move where we download the blobs to from the global blob dir, to somewhere under
/var/cache/snapd
.