Skip to content

Commit 23d40aa

Browse files
authored
Update rancher build script (#233)
Updated the Rancher build script in order to be able to build a specific version of kube-proxy if needed
1 parent 7308f80 commit 23d40aa

File tree

1 file changed

+31
-1
lines changed

1 file changed

+31
-1
lines changed

kubeadm/kube-proxy/build.ps1

Lines changed: 31 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,22 @@
1+
<#
2+
.SYNOPSIS
3+
Script that builds kube-proxy images
4+
5+
.DESCRIPTION
6+
This script build all kube-proxy images.
7+
It also has the possibility to build only a specific kube-proxy image. (optional)
8+
9+
.PARAMETER KubeProxyVersion (optional)
10+
Kubernetes version to specify which kube-proxy image to build
11+
12+
.EXAMPLE
13+
PS> .\build.ps1 -KubeProxyVersion v1.24.2
14+
15+
#>
16+
117
param(
18+
[parameter(Mandatory = $false)]
19+
[string] $KubeProxyVersion,
220
[string]$image = "sigwindowstools/kube-proxy",
321
[switch]$push,
422
[version]$minVersion = "1.22.0"
@@ -33,7 +51,19 @@ function Build-KubeProxy([string]$version)
3351
}
3452
}
3553

36-
$versions = (curl -L k8s.gcr.io/v2/kube-proxy/tags/list | ConvertFrom-Json).tags
54+
if($KubeProxyVersion)
55+
{
56+
if (!$KubeProxyVersion.StartsWith("v"))
57+
{
58+
$KubeProxyVersion = "v" + $KubeProxyVersion
59+
}
60+
$versions = @($KubeProxyVersion)
61+
}
62+
else
63+
{
64+
$versions = (curl -L k8s.gcr.io/v2/kube-proxy/tags/list | ConvertFrom-Json).tags
65+
}
66+
3767
foreach($version in $versions)
3868
{
3969
if ($version -match "^v(\d+\.\d+\.\d+)$")

0 commit comments

Comments
 (0)