File tree Expand file tree Collapse file tree 2 files changed +15
-1
lines changed
Expand file tree Collapse file tree 2 files changed +15
-1
lines changed Original file line number Diff line number Diff line change 3636 id : kubectl_versions
3737 run : |
3838 python --version
39- skopeo list-tags docker://registry.k8s.io/kubectl | jq -r '.Tags | .[]| select(. | match("v[0-9].[0-9]{2}.[0-9]$"))'
39+ export ALL_VERSIONS=$(skopeo list-tags docker://registry.k8s.io/kubectl | jq -r '.Tags | .[]| select(. | match("v[0-9].[0-9]{2}.[0-9]$"))')
40+ VERSIONS=$(python ./get_kubectl_versions.py)
41+ echo ${VERSIONS}
4042 echo "kubectl_versions=${VERSIONS} >> $GITHUB_OUTPUT
4143
4244
Original file line number Diff line number Diff line change 1+ #!/usr/bin/python3
2+ import os
3+ import json
4+ MIN_VERSION = 1.32
5+ versions = os .getenv ('VERSIONS' ).split ('\n ' )
6+ ret = {}
7+ for v in versions :
8+ vsplit = v .split ('.' )
9+ short_version = float ("." .join ([vsplit [0 ],vsplit [1 ]]).lstrip ("v" ))
10+ if short_version >= MIN_VERSION :
11+ ret [vsplit [1 ]] = v
12+ print (json .dumps (ret ))
You can’t perform that action at this time.
0 commit comments