Skip to content

Commit 15090ac

Browse files
committed
test(bootc-qcow2): scope greenboot install to Copr repo
Identical fix to the anaconda-iso sibling script: the generated Containerfile's dnf5 reinstall/install calls need to be scoped to the just-enabled Copr repo so a competing base-repo greenboot release can't outrank the Copr snapshot build and silently install unpatched code. Assisted-by: OpenCode (Claude Sonnet 5)
1 parent 10c652e commit 15090ac

1 file changed

Lines changed: 13 additions & 1 deletion

File tree

tests/greenboot-bootc-qcow2.sh

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -302,6 +302,18 @@ EOF
302302
;;
303303
esac
304304

305+
# Listing greenboot/greenboot-default-health-checks by name isn't enough to
306+
# guarantee the Copr build gets picked: dnf always resolves to the highest
307+
# NEVRA across all enabled repos, and Copr snapshot builds conventionally use
308+
# a Release starting at "0.<timestamp>...", the same convention official
309+
# pre-GA/rebuilt packages use. Whenever a base repo ships a greenboot release
310+
# that outranks the current Copr build, an unscoped reinstall/install would
311+
# silently fall back to the stock package instead. Restrict resolution to
312+
# just the just-enabled Copr repo so there is only one candidate regardless
313+
# of what other repos offer (see commit eb7d75c, which fixed the same class
314+
# of bug for the ostree/osbuild-composer flow).
315+
GREENBOOT_COPR_REPO_ID="copr:copr.fedorainfracloud.org:packit:fedora-iot-greenboot-rs-${PR_NUMBER}"
316+
305317
if [[ "${USE_COMPOSE_RPMS}" == true && -n "${GREENBOOT_PACKAGES_URL}" ]]; then
306318
tee -a Containerfile > /dev/null << EOF
307319
COPY greenboot-*.rpm /tmp/
@@ -314,7 +326,7 @@ else
314326
RUN (dnf install -y 'dnf5-command(copr)' || dnf install -y 'dnf-command(copr)') && \
315327
dnf copr enable -y packit/fedora-iot-greenboot-rs-${PR_NUMBER} ${COPR_CHROOT} && \
316328
dnf clean metadata && \
317-
(dnf reinstall -y greenboot greenboot-default-health-checks || dnf install -y greenboot greenboot-default-health-checks) && \
329+
(dnf reinstall -y --from-repo='${GREENBOOT_COPR_REPO_ID}' greenboot greenboot-default-health-checks || dnf install -y --from-repo='${GREENBOOT_COPR_REPO_ID}' greenboot greenboot-default-health-checks) && \
318330
systemctl enable greenboot-healthcheck.service
319331
EOF
320332
fi

0 commit comments

Comments
 (0)