File tree Expand file tree Collapse file tree 2 files changed +53
-0
lines changed Expand file tree Collapse file tree 2 files changed +53
-0
lines changed Original file line number Diff line number Diff line change 1+ # yaml-language-server: $schema=https://json.schemastore.org/github-workflow.json
2+ name : test-kube-proxy-images
3+
4+ on :
5+ schedule :
6+ - cron : ' 0 2 * * *' # Every day at 02:00 UTC
7+ workflow_dispatch :
8+
9+ jobs :
10+ build :
11+ name : Run script
12+ runs-on : windows-latest
13+
14+ steps :
15+ - uses : actions/checkout@v2
16+ - name : Test kube-proxy images
17+ run : powershell.exe ./hack/test-kube-proxy-images.ps1
Original file line number Diff line number Diff line change 1+ param (
2+ [string ]$minK8sVersion = " v1.22"
3+ )
4+
5+ # Get kube-proxy images
6+ $content = curl.exe - L registry.k8s.io/ v2/ kube- proxy/ tags/ list
7+ $json = ConvertFrom-Json $content
8+
9+ $missingKubeProxyImages = @ ()
10+
11+ foreach ($tag in $json.tags ) {
12+ if (-not ($tag.StartsWith (" v" ))) {
13+ continue
14+ }
15+ if ($tag.Contains (" -" )) {
16+ continue
17+ }
18+ if ([Version ]($tag.TrimStart (' v' )) -lt [Version ]($minK8sVersion.TrimStart (' v' ))) {
19+ continue
20+ }
21+
22+ foreach ($flavor in @ (" -calico-hostprocess" , " -flannel-hostprocess" )) {
23+ $image = " sigwindowstools/kube-proxy:$tag$flavor "
24+ Write-Output " Checking for image $image "
25+ docker manifest inspect $image | Out-Null
26+ if ($LastExitCode -ne 0 ) {
27+ $missingKubeProxyimages += $image
28+ Write-Output " Image $image is missing!"
29+ }
30+ }
31+ }
32+
33+ if ($missingKubeProxyImages.Length -gt 0 ) {
34+ Write-Output " Found ${$missingKubeProxyImages.Length} missing images!"
35+ exit 1
36+ }
You can’t perform that action at this time.
0 commit comments