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

asserts: add (optional) kernel-track to model assertion #5401

Merged
merged 2 commits into from Jul 16, 2018

Conversation

mvo5
Copy link
Contributor

@mvo5 mvo5 commented Jun 26, 2018

This allows specifying the kernel track in the model assertion
so that e.g. core18 can pull in a 4.15 kernel when building a
core18 system.

If this gets accepted we need to add code to snap prepare-image
to pull the kernel from the right track and also code to snapstate
to ensure the track of the kernel cannot be changed.

If it gets accepted we can also create official core18 model assertions
which means the code in #5398
can be reverted :)

This is also discussed in https://forum.snapcraft.io/t/5947

This allows specifying the kernel track in the model assertion
so that e.g. core18 can pull in a 4.15 kernel when building a
core18 system.

If this gets accepted we need to add code to `snap prepare-image`
to pull the kernel from the right track and also code to snapstate
to ensure the track of the kernel cannot be changed.

This is also discussed in https://forum.snapcraft.io/t/5947
@mvo5 mvo5 added the Core18 label Jun 26, 2018
Copy link
Collaborator

@zyga zyga left a comment

Choose a reason for hiding this comment

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

Looks good to me

@codecov-io
Copy link

codecov-io commented Jun 27, 2018

Codecov Report

Merging #5401 into master will decrease coverage by 0.03%.
The diff coverage is 100%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #5401      +/-   ##
==========================================
- Coverage      79%   78.97%   -0.04%     
==========================================
  Files         503      512       +9     
  Lines       37981    38756     +775     
==========================================
+ Hits        30007    30607     +600     
- Misses       5549     5692     +143     
- Partials     2425     2457      +32
Impacted Files Coverage Δ
asserts/device_asserts.go 99.02% <100%> (+0.03%) ⬆️
i18n/xgettext-go/main.go 84.97% <0%> (-3.78%) ⬇️
interfaces/policy/policy.go 93.6% <0%> (-3.21%) ⬇️
store/errors.go 77.17% <0%> (-1.31%) ⬇️
daemon/api.go 74.8% <0%> (-1.2%) ⬇️
overlord/ifacestate/handlers.go 65.27% <0%> (-0.67%) ⬇️
overlord/snapstate/snapstate.go 81.6% <0%> (-0.22%) ⬇️
overlord/ifacestate/helpers.go 66.55% <0%> (-0.12%) ⬇️
overlord/configstate/configcore/corecfg.go 67.34% <0%> (-0.1%) ⬇️
interfaces/builtin/udisks2.go 100% <0%> (ø) ⬆️
... and 43 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 8a6b8c7...13f39ca. Read the comment docs.

@@ -81,6 +81,11 @@ func (mod *Model) Kernel() string {
return mod.HeaderString("kernel")
}

// KernelTrack returns the kernel track the model uses.
Copy link
Collaborator

Choose a reason for hiding this comment

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

I think we want also a call to checkOptionalString(assert.headers, "kernel-track") in assembleModel

Copy link
Collaborator

Choose a reason for hiding this comment

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

@pedronis fixed and pushed, please have a look

This ensures that kernel-track is, if present, a string and that it is
not defined for classic models.

Signed-off-by: Zygmunt Krynicki <zygmunt.krynicki@canonical.com>
Copy link
Collaborator

@pedronis pedronis left a comment

Choose a reason for hiding this comment

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

thx

@mvo5 mvo5 changed the title [RFC] asserts: add (optional) kernel-track to model assertion asserts: add (optional) kernel-track to model assertion Jul 16, 2018
@mvo5 mvo5 merged commit 0c91754 into snapcore:master Jul 16, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
4 participants