From fbbf7258d004eb0cbfe909c67106cbe813446677 Mon Sep 17 00:00:00 2001 From: Joel Smith Date: Wed, 31 Jul 2024 16:04:17 -0600 Subject: [PATCH 1/2] Update relprep.sh to use matching keda-tools tag instead of latest Signed-off-by: Joel Smith --- hack/relprep.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/hack/relprep.sh b/hack/relprep.sh index f84f06274..d19c44df4 100755 --- a/hack/relprep.sh +++ b/hack/relprep.sh @@ -53,8 +53,8 @@ echo echo 'Running go mod tidy (pass 1)' go mod tidy -echo "Getting latest tag for keda-tools for version $gover" -bttag=$(skopeo list-tags docker://ghcr.io/kedacore/keda-tools | jq -r '.Tags|.[]' | sort --version-sort -r | head -1) +echo "Getting tag for keda-tools used to build KEDA version $ver" +bttag=$(curl -s "https://raw.githubusercontent.com/kedacore/keda/v${ver}/Dockerfile" | sed -n 's#^FROM.* ghcr.io/kedacore/keda-tools:\([0-9][0-9.]*\) AS builder$#\1#p;T;q') echo "Updating keda-tools tag to $bttag" while read f; do From 9a4848c305961b7406371a716545cff8f433a704 Mon Sep 17 00:00:00 2001 From: Joel Smith Date: Wed, 31 Jul 2024 16:44:26 -0600 Subject: [PATCH 2/2] Match KEDA build on mod versions of controller-runtime and -tools Signed-off-by: Joel Smith --- hack/relprep.sh | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/hack/relprep.sh b/hack/relprep.sh index d19c44df4..85f188469 100755 --- a/hack/relprep.sh +++ b/hack/relprep.sh @@ -13,6 +13,8 @@ set -e # these components k8s.io/ are versioned for each k8s release and should match the version of k8s used in KEDA for a given release kube_components="api apimachinery apiextensions-apiserver apiserver client-go component-base kube-aggregator" +match_keda_version_deps="sigs.k8s.io/controller-runtime sigs.k8s.io/controller-runtime/tools/setup-envtest sigs.k8s.io/controller-tools" + echo "Fetching sample CRs for KEDA v$ver" curl -s "https://raw.githubusercontent.com/kedacore/keda/v${ver}/config/samples/kustomization.yaml" > config/samples/kustomization.yaml for cr in $(sed -n '/^resources:$/,/^[^-]/ { s#[^0-9a-zA-Z_. -]##g; s#^- ##p}' config/samples/kustomization.yaml); do @@ -111,6 +113,17 @@ for i in $kube_components; do updated_mods["k8s.io/$i"]=1 done +for i in $match_keda_version_deps; do + echo -n checking upstream version of $i ..... + if ! modver=$(echo "$keda_gomod" | grep -Po '(?<=^\t'"$i"' )v[0-9]*\.[0-9]*\.[0-9]*(-[0-9]*(-[0-9a-e]*)?)?$'); then + echo " Unable to find $i in https://raw.githubusercontent.com/kedacore/keda/v${ver}/go.mod . Exiting!" + exit 1 + fi + echo " got version $modver" + to_update+=("$i@$modver") + updated_mods["$i"]=1 +done + # hack: force version of openshift API module based upon k8s->openshift version skew (e.g. 1.27 -> 4.14) openshift_branch="release-4.$(($(echo $k8sver | sed 's/v0\.\([0-9]*\)\.[0-9]*$/\1/')-13))" to_update+=("github.com/openshift/api@$openshift_branch")