oscontainer: Skip cosa commit if not present
I regularly develop on coreos-assembler outside of a container,
this key needs to be optional.
Regression from
See also e.g.
@@ -207,7 +207,9 @@ def oscontainer_build(containers_storage, tmpdir, src, ref, image_name_and_tag,
with open(metapath) as f:
meta = json.load(f)
rhcos_commit = meta['coreos-assembler.container-config-git']['commit']
- cosa_commit = meta['coreos-assembler.container-image-git']['commit']
+ imagegit = meta.get('coreos-assembler.container-image-git')
+ if imagegit is not None:
+ cosa_commit = imagegit['commit']
config += ['-l', f"com.coreos.coreos-assembler-commit={cosa_commit}"]
config += ['-l', f"com.coreos.redhat-coreos-commit={rhcos_commit}"]
