Skip to content

Commit 0378497

Browse files
authored
Merge pull request #237 from joelsmith/kedamain
Fix hack/relprep.sh script to match KEDA repo
2 parents 46329e6 + 9a4848c commit 0378497

File tree

1 file changed

+15
-2
lines changed

1 file changed

+15
-2
lines changed

hack/relprep.sh

+15-2
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,8 @@ set -e
1313
# these components k8s.io/<item> are versioned for each k8s release and should match the version of k8s used in KEDA for a given release
1414
kube_components="api apimachinery apiextensions-apiserver apiserver client-go component-base kube-aggregator"
1515

16+
match_keda_version_deps="sigs.k8s.io/controller-runtime sigs.k8s.io/controller-runtime/tools/setup-envtest sigs.k8s.io/controller-tools"
17+
1618
echo "Fetching sample CRs for KEDA v$ver"
1719
curl -s "https://raw.githubusercontent.com/kedacore/keda/v${ver}/config/samples/kustomization.yaml" > config/samples/kustomization.yaml
1820
for cr in $(sed -n '/^resources:$/,/^[^-]/ { s#[^0-9a-zA-Z_. -]##g; s#^- ##p}' config/samples/kustomization.yaml); do
@@ -53,8 +55,8 @@ echo
5355
echo 'Running go mod tidy (pass 1)'
5456
go mod tidy
5557

56-
echo "Getting latest tag for keda-tools for version $gover"
57-
bttag=$(skopeo list-tags docker://ghcr.io/kedacore/keda-tools | jq -r '.Tags|.[]' | sort --version-sort -r | head -1)
58+
echo "Getting tag for keda-tools used to build KEDA version $ver"
59+
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')
5860

5961
echo "Updating keda-tools tag to $bttag"
6062
while read f; do
@@ -111,6 +113,17 @@ for i in $kube_components; do
111113
updated_mods["k8s.io/$i"]=1
112114
done
113115

116+
for i in $match_keda_version_deps; do
117+
echo -n checking upstream version of $i .....
118+
if ! modver=$(echo "$keda_gomod" | grep -Po '(?<=^\t'"$i"' )v[0-9]*\.[0-9]*\.[0-9]*(-[0-9]*(-[0-9a-e]*)?)?$'); then
119+
echo " Unable to find $i in https://raw.githubusercontent.com/kedacore/keda/v${ver}/go.mod . Exiting!"
120+
exit 1
121+
fi
122+
echo " got version $modver"
123+
to_update+=("$i@$modver")
124+
updated_mods["$i"]=1
125+
done
126+
114127
# hack: force version of openshift API module based upon k8s->openshift version skew (e.g. 1.27 -> 4.14)
115128
openshift_branch="release-4.$(($(echo $k8sver | sed 's/v0\.\([0-9]*\)\.[0-9]*$/\1/')-13))"
116129
to_update+=("github.com/openshift/api@$openshift_branch")

0 commit comments

Comments
 (0)