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
Conversation
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
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.
Looks good to me
Codecov Report
@@ 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
Continue to review full report at Codecov.
|
@@ -81,6 +81,11 @@ func (mod *Model) Kernel() string { | |||
return mod.HeaderString("kernel") | |||
} | |||
|
|||
// KernelTrack returns the kernel track the model uses. |
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.
I think we want also a call to checkOptionalString(assert.headers, "kernel-track") in assembleModel
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.
@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>
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.
thx
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