Skip to content

Commit ca2029d

Browse files
jlebondustymabe
authored andcommitted
cmd-import: add coreos-assembler.container-image-git to meta.json
That key contains information about the cosa container image itself being used. There's some value in capturing this even just for knowing what `cosa import` code was executed, but it's also much more important when we talk about the disk images, which still heavily rely on cosa code. This should make the "COSA commit" key show up in the build browser.
1 parent 21bb665 commit ca2029d

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

src/cmd-import

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -154,6 +154,14 @@ def generate_build_meta(tmp_oci_archive, tmp_oci_manifest, metadata, ostree_comm
154154
'commit': commit,
155155
}
156156

157+
# add a reference to ourselves as well
158+
try:
159+
with open('/cosa/coreos-assembler-git.json') as f:
160+
cosa_git = json.load(f)
161+
meta['coreos-assembler.container-image-git'] = cosa_git['git']
162+
except FileNotFoundError:
163+
pass
164+
157165
return meta
158166

159167

0 commit comments

Comments
 (0)