From 26a4df287678c571c160b14eaace33b27269b07a Mon Sep 17 00:00:00 2001 From: adam <> Date: Thu, 31 Oct 2024 16:09:40 +0200 Subject: [PATCH] improve upper constraint handling This commit: - Provides a default value for the UPPER_CONSTRAINT docker file argument - Changes the prepare-image.sh logic to check the actual size of the upper constraint file and not the presence of it. Background of this change is that it has been noticed that on release branches during image building the "pinned" upper constraint file is not picked up rather pulled from upstream OpenStack because of a lack of default argument value during image building. Signed-off-by: Adam Rozman --- Dockerfile | 2 +- prepare-image.sh | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/Dockerfile b/Dockerfile index 1a7c7dadf..12505e361 100644 --- a/Dockerfile +++ b/Dockerfile @@ -31,7 +31,7 @@ ARG PATCH_LIST ARG INSTALL_TYPE=source # build arguments for source build customization -ARG UPPER_CONSTRAINTS_FILE +ARG UPPER_CONSTRAINTS_FILE=upper-constraints.txt ARG IRONIC_SOURCE ARG IRONIC_LIB_SOURCE ARG SUSHY_SOURCE diff --git a/prepare-image.sh b/prepare-image.sh index f0a4ab6f3..7e965206f 100755 --- a/prepare-image.sh +++ b/prepare-image.sh @@ -47,7 +47,7 @@ if [[ "$INSTALL_TYPE" == "source" ]]; then # NOTE(elfosardo): if the content of the upper-constraints file is empty, # we give as assumed that we're on the master branch - if [[ ! -f "${UPPER_CONSTRAINTS_PATH}" ]]; then + if [[ ! -s "${UPPER_CONSTRAINTS_PATH}" ]]; then UPPER_CONSTRAINTS_PATH="/tmp/upper-constraints.txt" curl -L https://releases.openstack.org/constraints/upper/master -o "${UPPER_CONSTRAINTS_PATH}" fi