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 committed Jan 28, 2021
1 parent e552a8c commit 420d25f
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/oscontainer.py
Original file line number Diff line number Diff line change
Expand Up @@ -193,6 +193,12 @@ 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(extensions['extensions'])
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 420d25f

Please sign in to comment.