Skip to content

Commit 59db511

Browse files
sxdmnencia
andauthored
chore: improve detection of released OpenShift versions (cloudnative-pg#9657)
The old regexp wasn't accepting versions over 4.19, now we add support to detect 4.20 and above. Other versions like 4.15 and 4.12 were excluded since those are not supported anymore or will not be supported in near future. Closes cloudnative-pg#8963 Signed-off-by: Jonathan Gonzalez V. <jonathan.gonzalez@enterprisedb.com> Signed-off-by: Marco Nenciarini <marco.nenciarini@enterprisedb.com> Co-authored-by: Marco Nenciarini <marco.nenciarini@enterprisedb.com>
1 parent 9caa0ea commit 59db511

File tree

1 file changed

+6
-8
lines changed

1 file changed

+6
-8
lines changed

.github/workflows/k8s-versions-check.yml

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ defaults:
2525
env:
2626
# The minimal k8s version supported, k8s version smaller than this one will be removed from vendor
2727
MINIMAL_K8S: "1.27"
28-
MINIMAL_OCP: "4.12"
28+
MINIMAL_OCP: "4.14"
2929

3030
jobs:
3131

@@ -106,17 +106,15 @@ jobs:
106106
-
107107
name: Get updated OpenShift versions
108108
run: |
109-
# We limit the range starting on 4 to 9 to skip the 13 version
110-
# this needs to be updated when the 15 version is also EOL
109+
# Match OpenShift 4.14, 4.16-4.19, and 4.20+
110+
# Version 4.15 is excluded as it is EOL
111111
curl -s https://mirror.openshift.com/pub/openshift-v4/clients/ocp/ | \
112-
grep -e 'href.*"4\.1[24-9]\.[0-9].*"' | \
113-
sed -e 's/\(.*\)href="\(4\.1[2-9]\)\(.*\)/\2/' | \
112+
grep -Eo 'href.*"4\.(1[46-9]|[2-9][0-9])\.[0-9].*"' | \
113+
grep -v rc | \
114+
sed -E 's/href="//;s/\/"//;s/(4\.(1[46-9]|[2-9][0-9]))(\..*$)/\1/' | \
114115
sort -Vru | \
115116
awk -vv="$MINIMAL_OCP" '$0>=v {print $0}' | \
116117
jq -Rn '[inputs]' | tee .github/openshift_versions.json
117-
118-
OCP_VERSIONS=`cat .github/openshift_versions.json | jq -r '"v"+.[-1]+"-v"+.[0]'`
119-
sed -i -e 's/\(OPENSHIFT_VERSIONS ?= \)\(.*\)/\1'${OCP_VERSIONS}'/g' Makefile
120118
if: github.event.inputs.limit == null || github.event.inputs.limit == 'ocp'
121119
-
122120
name: Create Pull Request if versions have been updated

0 commit comments

Comments
 (0)