-
Notifications
You must be signed in to change notification settings - Fork 62
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
Fix calculation of sizes and offset #156
Fix calculation of sizes and offset #156
Conversation
Let snapd calculate minimal image size and offsets instead of doing it from ubuntu-image code.
1902156
to
7e3a54d
Compare
Codecov Report
@@ Coverage Diff @@
## main #156 +/- ##
==========================================
+ Coverage 90.44% 90.47% +0.03%
==========================================
Files 11 11
Lines 2449 2457 +8
==========================================
+ Hits 2215 2223 +8
Misses 208 208
Partials 26 26
|
// last one in gadget.yaml). Note that we only have one volume | ||
// (see check above). | ||
var yamlIndex int | ||
for _, vol := range stateMachine.GadgetInfo.Volumes { |
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.
Just below we use a different heuristic to get the last volume stateMachine.GadgetInfo.Volumes[lastVolumeName].Structure
We should probably pick one and use it at both places.
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.
Very good point, I hadn't noticed that. I've shuffled code a bit, as I don't think we need lastVolumeName
even.
7e3a54d
to
7bc6883
Compare
7bc6883
to
a1ef96a
Compare
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
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.
Changes make sense indeed, let's merge them.
Let snapd calculate minimal image size and offsets instead of doing it from ubuntu-image code.