Skip to content

Commit 5cf486a

Browse files
authored
Merge pull request kubernetes-sigs#570 from CecileRobertMichon/fix-ci-version
conformance: fix kubeadm version when using CI_VERSION
2 parents 7313307 + 963b0e3 commit 5cf486a

File tree

3 files changed

+48
-3
lines changed

3 files changed

+48
-3
lines changed

scripts/ci-conformance.sh

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -72,15 +72,16 @@ create_cluster() {
7272
# export cluster template which contains the manifests needed for creating the Azure cluster to run the tests
7373
if [[ -n ${CI_VERSION:-} || -n ${USE_CI_ARTIFACTS:-} ]]; then
7474
export CLUSTER_TEMPLATE="test/cluster-template-conformance-ci-version.yaml"
75+
export CI_VERSION=${CI_VERSION:-$(curl -sSL https://dl.k8s.io/ci/k8s-master.txt)}
76+
export KUBERNETES_VERSION=${CI_VERSION}
7577
else
7678
export CLUSTER_TEMPLATE="test/cluster-template-conformance.yaml"
7779
fi
7880

7981
export CLUSTER_NAME="capz-conformance-$(head /dev/urandom | LC_ALL=C tr -dc a-z0-9 | head -c 6 ; echo '')"
8082
# Conformance test suite needs a cluster with at least 2 nodes
81-
export CONTROL_PLANE_MACHINE_COUNT=${CONTROL_PLANE_MACHINE_COUNT:-3}
83+
export CONTROL_PLANE_MACHINE_COUNT=${CONTROL_PLANE_MACHINE_COUNT:-1}
8284
export WORKER_MACHINE_COUNT=${WORKER_MACHINE_COUNT:-2}
83-
export CI_VERSION=${CI_VERSION:-$(curl -sSL https://dl.k8s.io/ci/k8s-master.txt)}
8485
export REGISTRY=conformance
8586
# timestamp is in RFC-3339 format to match kubetest
8687
export TIMESTAMP=$(date -u '+%Y-%m-%dT%H:%M:%SZ')

templates/test/cluster-template-conformance-ci-version.yaml

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -323,6 +323,12 @@ metadata:
323323
spec:
324324
template:
325325
spec:
326+
image:
327+
marketplace:
328+
offer: capi
329+
publisher: cncf-upstream
330+
sku: k8s-1dot18dot2-ubuntu-1804
331+
version: 2020.04.17
326332
location: ${AZURE_LOCATION}
327333
osDisk:
328334
diskSizeGB: 128
@@ -340,6 +346,12 @@ metadata:
340346
spec:
341347
template:
342348
spec:
349+
image:
350+
marketplace:
351+
offer: capi
352+
publisher: cncf-upstream
353+
sku: k8s-1dot18dot2-ubuntu-1804
354+
version: 2020.04.17
343355
location: ${AZURE_LOCATION}
344356
osDisk:
345357
diskSizeGB: 30

templates/test/conformance-ci-version/patches/ci-version.yaml

Lines changed: 33 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -106,6 +106,22 @@ spec:
106106
"useInstanceMetadata": true
107107
}
108108
---
109+
apiVersion: infrastructure.cluster.x-k8s.io/v1alpha3
110+
kind: AzureMachineTemplate
111+
metadata:
112+
name: "${CLUSTER_NAME}-control-plane"
113+
spec:
114+
template:
115+
spec:
116+
image:
117+
# we use the 1.18.2 image as a workaround there is no published marketplace image for k8s CI versions.
118+
# 1.18.2 binaries and images will get replaced to the desired version by the script above.
119+
marketplace:
120+
publisher: cncf-upstream
121+
offer: capi
122+
sku: k8s-1dot18dot2-ubuntu-1804
123+
version: "2020.04.17"
124+
---
109125
apiVersion: bootstrap.cluster.x-k8s.io/v1alpha3
110126
kind: KubeadmConfigTemplate
111127
metadata:
@@ -209,4 +225,20 @@ spec:
209225
"maximumLoadBalancerRuleCount": 250,
210226
"useManagedIdentityExtension": false,
211227
"useInstanceMetadata": true
212-
}
228+
}
229+
---
230+
apiVersion: infrastructure.cluster.x-k8s.io/v1alpha3
231+
kind: AzureMachineTemplate
232+
metadata:
233+
name: ${CLUSTER_NAME}-md-0
234+
spec:
235+
template:
236+
spec:
237+
image:
238+
# we use the 1.18.2 image as a workaround there is no published marketplace image for k8s CI versions.
239+
# 1.18.2 binaries and images will get replaced to the desired version by the script above.
240+
marketplace:
241+
publisher: cncf-upstream
242+
offer: capi
243+
sku: k8s-1dot18dot2-ubuntu-1804
244+
version: "2020.04.17"

0 commit comments

Comments
 (0)