Skip to content

Commit 21bb665

Browse files
jlebondustymabe
authored andcommitted
cmd-import: add coreos-assembler.container-config-git to meta.json
That key traditionally represented git information about the source config repo that was built. But now in the buidah path, the source of truth for this information has moved to the standard OCI labels. But for convenience and because a bunch of things check for this in the old place (notably the build browser and the release job), just proxy that info under the same key into `meta.json` as before. This should make the "FCOS commit" key show up in the build browser.
1 parent 1431ba8 commit 21bb665

File tree

1 file changed

+12
-1
lines changed

1 file changed

+12
-1
lines changed

src/cmd-import

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -119,7 +119,7 @@ def generate_build_meta(tmp_oci_archive, tmp_oci_manifest, metadata, ostree_comm
119119
created_timestamp = parse_timestamp(metadata['Created'])
120120
arch = get_basearch()
121121

122-
return {
122+
meta = {
123123
'ostree-commit': ostree_commit,
124124
'ostree-version': buildid,
125125
'buildid': buildid,
@@ -145,6 +145,17 @@ def generate_build_meta(tmp_oci_archive, tmp_oci_manifest, metadata, ostree_comm
145145
},
146146
}
147147

148+
# proxy build repo and commit to the standard cosa key
149+
source = metadata.get('Labels', {}).get('org.opencontainers.image.source')
150+
commit = metadata.get('Labels', {}).get('org.opencontainers.image.revision')
151+
if source and commit:
152+
meta['coreos-assembler.container-config-git'] = {
153+
'origin': source,
154+
'commit': commit,
155+
}
156+
157+
return meta
158+
148159

149160
def finalize_build(builds, build_meta, tmp_oci_archive, tmp_oci_manifest, tmp_lockfile):
150161
buildid = build_meta['buildid']

0 commit comments

Comments
 (0)