|
13 | 13 | # 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
|
14 | 14 | kube_components="api apimachinery apiextensions-apiserver apiserver client-go component-base kube-aggregator"
|
15 | 15 |
|
| 16 | +match_keda_version_deps="sigs.k8s.io/controller-runtime sigs.k8s.io/controller-runtime/tools/setup-envtest sigs.k8s.io/controller-tools" |
| 17 | + |
16 | 18 | echo "Fetching sample CRs for KEDA v$ver"
|
17 | 19 | curl -s "https://raw.githubusercontent.com/kedacore/keda/v${ver}/config/samples/kustomization.yaml" > config/samples/kustomization.yaml
|
18 | 20 | for cr in $(sed -n '/^resources:$/,/^[^-]/ { s#[^0-9a-zA-Z_. -]##g; s#^- ##p}' config/samples/kustomization.yaml); do
|
|
53 | 55 | echo 'Running go mod tidy (pass 1)'
|
54 | 56 | go mod tidy
|
55 | 57 |
|
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') |
58 | 60 |
|
59 | 61 | echo "Updating keda-tools tag to $bttag"
|
60 | 62 | while read f; do
|
@@ -111,6 +113,17 @@ for i in $kube_components; do
|
111 | 113 | updated_mods["k8s.io/$i"]=1
|
112 | 114 | done
|
113 | 115 |
|
| 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 | + |
114 | 127 | # hack: force version of openshift API module based upon k8s->openshift version skew (e.g. 1.27 -> 4.14)
|
115 | 128 | openshift_branch="release-4.$(($(echo $k8sver | sed 's/v0\.\([0-9]*\)\.[0-9]*$/\1/')-13))"
|
116 | 129 | to_update+=("github.com/openshift/api@$openshift_branch")
|
|
0 commit comments