-
Notifications
You must be signed in to change notification settings - Fork 34
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
add stacker version as annotation to images #602
add stacker version as annotation to images #602
Conversation
Looks good to me, but would also like to see the oci annotation. |
8ff13ae
to
5303764
Compare
here's an example of a manifest with the annotation we get from this change: {
"schemaVersion": 2,
"mediaType": "application/vnd.oci.image.manifest.v1+json",
"config": {
"mediaType": "application/vnd.oci.image.config.v1+json",
"digest": "sha256:8234d3f66d0841bdaf46c406fa657ff0c8656a140cc9644169f6437268668ff1",
"size": 709
},
"layers": [
{
"mediaType": "application/vnd.oci.image.layer.v1.tar+gzip",
"digest": "sha256:6d7944e47a2816085f3558cbd8f8b1c9ab7ea946908701dc86e824d41316daf4",
"size": 1916744
},
{
"mediaType": "application/vnd.oci.image.layer.v1.tar+gzip",
"digest": "sha256:8f8602a5f876184701dc7aff30b2401f8cd6b1cf80153ec560c9b6b1927041aa",
"size": 209
}
],
"annotations": {
"io.stackeroci.stacker.stacker_version": "v1.0.0-rc12-3-gef4e4be-dirty",
"io.stackeroci.stacker.stacker_yaml": "\nminbasebase:\n build_only: true\n from:\n type: tar\n url: minrfs-w-resolvconf-and-dirs.tgz\n\nminbase:\n from:\n type: built\n tag: minbasebase\n run: |\n echo \"foo\" > \"/usr/local/bin/foo\"\n echo \"$(</etc/resolv.conf)\"\n echo done.\n"
}
} |
It can be useful to know which version of stacker created an image. Let's put it in there. Moves some things around to avoid multiple definitions & import loops. Signed-off-by: Michael McCracken <[email protected]>
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #602 +/- ##
==========================================
+ Coverage 57.38% 57.46% +0.07%
==========================================
Files 64 65 +1
Lines 7566 7709 +143
==========================================
+ Hits 4342 4430 +88
- Misses 2481 2522 +41
- Partials 743 757 +14 ☔ 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.
+1 -- maybe a quick pkg/lib/version_test.go to make codecov happy?
I'm not too familiar with codecov, having a hard time making sense of its view. I don't think it's referring to pkg/lib/version.go - it claims the lines added in api.go don't have tests associated, but there are no unit tests for anything in there (and there shouldn't be, it is just wrappers around Sprintf)... I assume it's getting coverage from the integration bats tests too, but when I look in codecov to see how the other funcs in api.go are being covered, it now says all the lines in that file are covered - in this view of the PR on codecov https://app.codecov.io/gh/project-stacker/stacker/pull/602 it says the PR's changes have 100% coverage. Not sure how to satisfy it |
I'm not quite sure either, but most files in |
b9452c3
to
5303764
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.
all this should be part of in-toto metadata in the long-term
It can be useful to know which version of stacker created an image. Let's put it in there.
Moves some things around to avoid multiple definitions & import loops.