Skip to content

Commit 71c87db

Browse files
committed
drop formatting vars in processed image.yaml files
Fedora CoreOS is the only one today using the variable replacement in the image.yaml files (see [1]). Fedora CoreOS is also moved over to building via container so it's not using the code here in COSA to generate the image.json (uses build-rootfs code instead). Let's drop this formatting code for now to simplify. [1] https://github.com/coreos/fedora-coreos-config/blob/286f84bbcc9b233ad065287845b6e21bb0bef306/image-base.yaml#L38
1 parent 9219b52 commit 71c87db

File tree

2 files changed

+6
-8
lines changed

2 files changed

+6
-8
lines changed

src/cmdlib.sh

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -228,7 +228,7 @@ prepare_build() {
228228
fi
229229

230230
export image_json="${tmp_builddir}/image.json"
231-
write_image_json "${image}" "${image_json}" "${manifest}"
231+
write_image_json "${image}" "${image_json}"
232232
# These need to be absolute paths right now for rpm-ostree
233233
composejson="$(readlink -f "${workdir}"/tmp/compose.json)"
234234
export composejson
@@ -1084,12 +1084,11 @@ print('Build ${buildid} was inserted ${arch:+for $arch}')")
10841084
write_image_json() {
10851085
local srcfile=$1; shift
10861086
local outfile=$1; shift
1087-
local ostree_manifest=$1; shift
10881087
(python3 -c "
10891088
import sys
10901089
sys.path.insert(0, '${DIR}')
10911090
from cosalib import cmdlib
1092-
cmdlib.write_image_json('${srcfile}', '${outfile}', ostree_manifest='${ostree_manifest}')")
1091+
cmdlib.write_image_json('${srcfile}', '${outfile}')")
10931092
}
10941093

10951094
# API to prepare image builds.

src/cosalib/cmdlib.py

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -523,16 +523,15 @@ def cmdlib_sh(script):
523523
'''])
524524

525525

526-
def generate_image_json(srcfile, ostree_manifest):
527-
manifest_vars = yaml.safe_load(open(ostree_manifest))['variables']
526+
def generate_image_json(srcfile):
528527
r = yaml.safe_load(open("/usr/lib/coreos-assembler/image-default.yaml"))
529-
for k, v in flatten_image_yaml(srcfile, format_args=manifest_vars).items():
528+
for k, v in flatten_image_yaml(srcfile).items():
530529
r[k] = v
531530
return r
532531

533532

534-
def write_image_json(srcfile, outfile, ostree_manifest):
535-
r = generate_image_json(srcfile, ostree_manifest)
533+
def write_image_json(srcfile, outfile):
534+
r = generate_image_json(srcfile)
536535
with open(outfile, 'w') as f:
537536
json.dump(r, f, sort_keys=True)
538537

0 commit comments

Comments
 (0)