Skip to content
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

Merged
merged 2 commits into from
Oct 18, 2023

Conversation

alfonsosanchezbeato
Copy link
Member

Let snapd calculate minimal image size and offsets instead of doing it from ubuntu-image code.

Let snapd calculate minimal image size and offsets instead of doing it
from ubuntu-image code.
@codecov
Copy link

codecov bot commented Oct 17, 2023

Codecov Report

Merging #156 (a1ef96a) into main (c5f0cdc) will increase coverage by 0.03%.
Report is 9 commits behind head on main.
The diff coverage is 100.00%.

@@            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              
Files Coverage Δ
internal/statemachine/classic_states.go 97.28% <100.00%> (+0.05%) ⬆️
internal/statemachine/common_states.go 100.00% <100.00%> (ø)
internal/statemachine/helper.go 98.64% <100.00%> (-0.02%) ⬇️
internal/statemachine/state_machine.go 98.02% <100.00%> (+0.02%) ⬆️

// last one in gadget.yaml). Note that we only have one volume
// (see check above).
var yamlIndex int
for _, vol := range stateMachine.GadgetInfo.Volumes {
Copy link
Collaborator

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.

Copy link
Member Author

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.

Copy link
Collaborator

@upils upils left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

Copy link
Contributor

@sil2100 sil2100 left a 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.

@upils upils merged commit 5b904da into canonical:main Oct 18, 2023
10 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants