-
Notifications
You must be signed in to change notification settings - Fork 184
src/oscontainer.py: Add pkglist.txt to container root #661
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
Conversation
|
My only question is if there is a valid use case where there is no version for ostree.
|
Probably not, but as I noted above I think I wrote the command originally here wrong...we should really imagine this to be |
dea2820 to
c562c44
Compare
c562c44 to
f20baff
Compare
|
Thoughts on https://bugzilla.redhat.com/show_bug.cgi?id=1731317#c2? Just to expand on this a little bit. Commit metadata is a mishmash of both stable and unstable things. E.g. the If all we really need here is the pkglist, then it seems much more low-risk to me to just export a |
To be clear, while I'm talking about the layered version here, and this is a "base layer" commit (which has much fewer keys), but one can imagine a strategy where the oscontainer in fact contains a layered commit with e.g. newer kubelet or whatever. There's also the higher-level concern that from this point on, any new key we add is essentially de facto made stable. |
I see what you're saying but OTOH this content is in our build buckets too. But it's also fine by me to filter it to just the pkglist. |
Right, I guess this is the first ask I come across where we're directly saying to someone else "please use the IIRC, the motivation for extracting the |
|
@jlebon to clarify, this would be: Correct? |
|
That'd work, though diff --git a/src/oscontainer.py b/src/oscontainer.py
index 96ab2aa..a338c02 100755
--- a/src/oscontainer.py
+++ b/src/oscontainer.py
@@ -10,8 +10,9 @@
import gi
gi.require_version('OSTree', '1.0')
+gi.require_version('RpmOstree', '1.0')
-from gi.repository import GLib, Gio, OSTree
+from gi.repository import GLib, Gio, OSTree, RpmOstree
import argparse
import json
@@ -117,6 +118,12 @@ def oscontainer_build(containers_storage, src, ref, image_name_and_tag,
print("Copying ostree commit into container: {} ...".format(rev))
run_verbose(["ostree", "--repo=" + dest_repo, "pull-local", src, rev])
+ pkgs = RpmOstree.db_query_all(r, rev, None)
+ with open(os.path.join(mnt, 'pkglist.txt'), 'w') as f:
+ for pkg in pkgs:
+ f.write(pkg.get_nevra())
+ f.write('\n')
+
# We use /noentry to trick `podman create` into not erroring out
# on a container with no cmd/entrypoint. It won't actually be run.
config = ['--entrypoint', '["/noentry"]', |
f20baff to
0c82eef
Compare
|
@jlebon PTAL. Tested locally. |
jlebon
left a comment
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!
See: https://bugzilla.redhat.com/show_bug.cgi?id=1731317 Signed-off-by: Steve Milner <smilner@redhat.com>
0c82eef to
776b50c
Compare
|
Updated |
See: https://bugzilla.redhat.com/show_bug.cgi?id=1731317
For testing I:
/cc @jasinner