Skip to content

Commit

Permalink
oscontainer: add com.coreos.os-extensions label
Browse files Browse the repository at this point in the history
This label contains a semi-colon-separated list of extensions baked in
the oscontainer. This will be used by the humans and the MCO for
validation:

openshift/os#409 (comment)
  • Loading branch information
jlebon authored and openshift-merge-robot committed Feb 23, 2021
1 parent 4cddfae commit db45f55
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions src/oscontainer.py
Original file line number Diff line number Diff line change
Expand Up @@ -193,6 +193,13 @@ def oscontainer_build(containers_storage, tmpdir, src, ref, image_name_and_tag,
os.makedirs(dest_dir, exist_ok=True)
run_verbose(["tar", "-xf", tarball], cwd=dest_dir)

with open(os.path.join(dest_dir, 'extensions.json')) as f:
extensions = json.load(f)

extensions_label = ';'.join([ext for (ext, obj) in extensions['extensions'].items()
if obj.get('kind', 'os-extension') == 'os-extension'])
config += ['-l', f"com.coreos.os-extensions={extensions_label}"]

if display_name is not None:
config += ['-l', 'io.openshift.build.version-display-names=machine-os=' + display_name,
'-l', 'io.openshift.build.versions=machine-os=' + ostree_version]
Expand Down

0 comments on commit db45f55

Please sign in to comment.