Skip to content

Commit 4234907

Browse files
committed
cmd-build-with-buildah: add FCOS stream label manually
This is for coreos/fedora-coreos-tracker#1996. I initially wanted to just add another `LABEL` to our Containerfile and hook that up to another build arg, but the problem is that our Containerfile is shared with RHCOS/SCOS and there's no way to make `LABEL` directives conditional. I opened coreos/rpm-ostree#5454 which will fix this but for now to not block on this, let's just slap it on from the cosa side. Once it's folded back into the build process proper, then we can rever this. But the label not existing shouldn't really affect the majority of developers anyway.
1 parent 3654be1 commit 4234907

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

src/cmd-build-with-buildah

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -73,8 +73,10 @@ build_with_buildah() {
7373
initconfig="src/config.json"
7474
if [ -f "${initconfig}" ]; then
7575
variant="$(jq --raw-output '."coreos-assembler.config-variant"' "${initconfig}")"
76+
manifest="src/config/manifest-${variant}.yaml"
7677
argsfile=build-args-${variant}.conf
7778
else
79+
manifest="src/config/manifest.yaml"
7880
argsfile=build-args.conf
7981
fi
8082

@@ -88,6 +90,14 @@ build_with_buildah() {
8890
--build-arg VERSION="${VERSION}" \
8991
-t oci-archive:"${tmp_oci_archive_path}"
9092

93+
# XXX: Temporary hack until we have https://github.com/coreos/rpm-ostree/pull/5454
94+
# which would allow us to fold this back into the build process.
95+
# shellcheck source=/dev/null
96+
stream=$(yaml2json "$manifest" /dev/stdout | jq -r '.variables.stream')
97+
if [ "${stream}" != null ]; then
98+
set -- "$@" --label fedora-coreos.stream="$stream"
99+
fi
100+
91101
if [ -n "$DIRECT" ]; then
92102
# turn on layer caching in the direct case; it wouldn't hurt in the
93103
# supermin path, but it'd be a waste of space on the rootfs

0 commit comments

Comments
 (0)