Skip to content

Commit ae99174

Browse files
authored
Adding a GH action to ensure we have build all versions of Windows kube-proxy image (#243)
Signed-off-by: Mark Rossetti <[email protected]> Signed-off-by: Mark Rossetti <[email protected]>
1 parent 9b61b45 commit ae99174

File tree

2 files changed

+53
-0
lines changed

2 files changed

+53
-0
lines changed
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
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

hack/test-kube-proxy-images.ps1

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
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+
}

0 commit comments

Comments
 (0)