Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

🐛 Pin kindest/node images to known good versions in clusterctl upgrade tests #8860

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
30 changes: 18 additions & 12 deletions test/e2e/clusterctl_upgrade_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ var _ = Describe("When testing clusterctl upgrades (v0.4=>current)", func() {
SkipCleanup: skipCleanup,
InitWithBinary: "https://github.com/kubernetes-sigs/cluster-api/releases/download/v0.4.8/clusterctl-{OS}-{ARCH}",
InitWithProvidersContract: "v1alpha4",
// NOTE: If this version is changed here the image and SHA must also be updated in all DockerMachineTemplates in `test/data/infrastructure-docker/v0.4/bases.
InitWithKubernetesVersion: "v1.23.17",
WorkloadKubernetesVersion: "v1.23.17",
MgmtFlavor: "topology",
Expand Down Expand Up @@ -73,10 +74,11 @@ var _ = Describe("When testing clusterctl upgrades (v1.0=>current)", func() {
// runtime extension providers. If we don't do this the test will automatically
// try to deploy the latest version of our test-extension from docker.yaml.
InitWithRuntimeExtensionProviders: []string{},
InitWithKubernetesVersion: "v1.23.17",
WorkloadKubernetesVersion: "v1.23.17",
MgmtFlavor: "topology",
WorkloadFlavor: "",
// NOTE: If this version is changed here the image and SHA must also be updated in all DockerMachineTemplates in `test/data/infrastructure-docker/v1.0/bases.
InitWithKubernetesVersion: "v1.23.17",
WorkloadKubernetesVersion: "v1.23.17",
MgmtFlavor: "topology",
WorkloadFlavor: "",
// This check ensures that ownerReference apiVersions are updated for all types after the upgrade.
PostUpgrade: func(proxy framework.ClusterProxy, namespace, clusterName string) {
killianmuldoon marked this conversation as resolved.
Show resolved Hide resolved
framework.ValidateOwnerReferencesOnUpdate(proxy, namespace,
Expand Down Expand Up @@ -112,10 +114,11 @@ var _ = Describe("When testing clusterctl upgrades (v1.3=>current)", func() {
// try to deploy the latest version of our test-extension from docker.yaml.
InitWithRuntimeExtensionProviders: []string{},
InitWithProvidersContract: "v1beta1",
InitWithKubernetesVersion: "v1.26.4",
WorkloadKubernetesVersion: "v1.26.4",
MgmtFlavor: "topology",
WorkloadFlavor: "",
// NOTE: If this version is changed here the image and SHA must also be updated in all DockerMachineTemplates in `test/data/infrastructure-docker/v1.3/bases.
InitWithKubernetesVersion: "v1.26.4",
WorkloadKubernetesVersion: "v1.26.4",
MgmtFlavor: "topology",
WorkloadFlavor: "",
// This check ensures that ownerReference apiVersions are updated for all types after the upgrade.
PostUpgrade: func(proxy framework.ClusterProxy, namespace, clusterName string) {
framework.ValidateOwnerReferencesOnUpdate(proxy, namespace,
Expand Down Expand Up @@ -151,10 +154,11 @@ var _ = Describe("When testing clusterctl upgrades using ClusterClass (v1.3=>cur
// try to deploy the latest version of our test-extension from docker.yaml.
InitWithRuntimeExtensionProviders: []string{},
InitWithProvidersContract: "v1beta1",
InitWithKubernetesVersion: "v1.26.4",
WorkloadKubernetesVersion: "v1.26.4",
MgmtFlavor: "topology",
WorkloadFlavor: "topology",
// NOTE: If this version is changed here the image and SHA must also be updated in all DockerMachineTemplates in `test/data/infrastructure-docker/v1.3/bases.
InitWithKubernetesVersion: "v1.26.4",
WorkloadKubernetesVersion: "v1.26.4",
MgmtFlavor: "topology",
WorkloadFlavor: "topology",
// This check ensures that ownerReference apiVersions are updated for all types after the upgrade.
PostUpgrade: func(proxy framework.ClusterProxy, namespace, clusterName string) {
framework.ValidateOwnerReferencesOnUpdate(proxy, namespace,
Expand All @@ -180,6 +184,7 @@ var _ = Describe("When testing clusterctl upgrades (v1.4=>current)", func() {
SkipCleanup: skipCleanup,
InitWithBinary: "https://github.com/kubernetes-sigs/cluster-api/releases/download/v1.4.0/clusterctl-{OS}-{ARCH}",
InitWithProvidersContract: "v1beta1",
// NOTE: If this version is changed here the image and SHA must also be updated in all DockerMachineTemplates in `test/data/infrastructure-docker/v1.4/bases.
InitWithKubernetesVersion: "v1.27.1",
WorkloadKubernetesVersion: "v1.27.1",
MgmtFlavor: "topology",
Expand Down Expand Up @@ -209,6 +214,7 @@ var _ = Describe("When testing clusterctl upgrades using ClusterClass (v1.4=>cur
SkipCleanup: skipCleanup,
InitWithBinary: "https://github.com/kubernetes-sigs/cluster-api/releases/download/v1.4.0/clusterctl-{OS}-{ARCH}",
InitWithProvidersContract: "v1beta1",
// NOTE: If this version is changed here the image and SHA must also be updated in all DockerMachineTemplates in `test/data/infrastructure-docker/v1.4/bases.
InitWithKubernetesVersion: "v1.27.1",
WorkloadKubernetesVersion: "v1.27.1",
MgmtFlavor: "topology",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -196,30 +196,58 @@ spec:
- name: customImage
description: "Sets the container image that is used for running dockerMachines for the controlPlane and default-worker machineDeployments."
definitions:
- selector:
apiVersion: infrastructure.cluster.x-k8s.io/v1beta1
kind: DockerMachineTemplate
matchResources:
machineDeploymentClass:
names:
- default-worker
jsonPatches:
- op: add
path: "/spec/template/spec/customImage"
valueFrom:
template: |
kindest/node:{{ .builtin.machineDeployment.version | replace "+" "_" }}
- selector:
apiVersion: infrastructure.cluster.x-k8s.io/v1beta1
kind: DockerMachineTemplate
matchResources:
controlPlane: true
jsonPatches:
- op: add
path: "/spec/template/spec/customImage"
valueFrom:
template: |
kindest/node:{{ .builtin.controlPlane.version | replace "+" "_" }}
- selector:
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These patches should be reverted once we have kindest/node version resolution in CAPD.

apiVersion: infrastructure.cluster.x-k8s.io/v1beta1
kind: DockerMachineTemplate
matchResources:
machineDeploymentClass:
names:
- default-worker
jsonPatches:
- op: add
path: "/spec/template/spec/customImage"
valueFrom:
template: |
kindest/node:{{ .builtin.machineDeployment.version | replace "+" "_" }}
- selector:
apiVersion: infrastructure.cluster.x-k8s.io/v1beta1
kind: DockerMachineTemplate
matchResources:
controlPlane: true
jsonPatches:
- op: add
path: "/spec/template/spec/customImage"
valueFrom:
template: |
kindest/node:{{ .builtin.controlPlane.version | replace "+" "_" }}
- name: replaceImage-v1.23.17-machineDeployment
description: "Sets the container image for MD DockerMachineTemplates using Kubernetes v1.23.17."
enabledIf: '{{ semverCompare "v1.23.17" .builtin.machineDeployment.version }}'
definitions:
- selector:
apiVersion: infrastructure.cluster.x-k8s.io/v1beta1
kind: DockerMachineTemplate
matchResources:
machineDeploymentClass:
names:
- default-worker
jsonPatches:
- op: add
path: "/spec/template/spec/customImage"
value: "kindest/node:v1.23.17@sha256:f77f8cf0b30430ca4128cc7cfafece0c274a118cd0cdb251049664ace0dee4ff"
- name: replaceImage-v1.23.17-controlPlane
description: "Sets the container image for CP DockerMachineTemplates using Kubernetes v1.23.17."
enabledIf: '{{ semverCompare "v1.23.17" .builtin.controlPlane.version }}'
definitions:
- selector:
apiVersion: infrastructure.cluster.x-k8s.io/v1beta1
kind: DockerMachineTemplate
matchResources:
controlPlane: true
jsonPatches:
- op: add
path: "/spec/template/spec/customImage"
value: "kindest/node:v1.23.17@sha256:f77f8cf0b30430ca4128cc7cfafece0c274a118cd0cdb251049664ace0dee4ff"
- name: preloadImages
description: |
Sets the container images to preload to the node that is used for running dockerMachines.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,8 @@ metadata:
spec:
template:
spec:
# NOTE: If the Kubernetes version is changed in `clusterctl_upgrade_test.go` the image and SHA must be updated here.
customImage: "kindest/node:v1.23.17@sha256:f77f8cf0b30430ca4128cc7cfafece0c274a118cd0cdb251049664ace0dee4ff"
extraMounts:
- containerPath: "/var/run/docker.sock"
hostPath: "/var/run/docker.sock"
Expand Down
2 changes: 2 additions & 0 deletions test/e2e/data/infrastructure-docker/v0.4/bases/md.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@ metadata:
spec:
template:
spec:
# NOTE: If the Kubernetes version is changed in `clusterctl_upgrade_test.go` the image and SHA must be updated here.
customImage: "kindest/node:v1.23.17@sha256:f77f8cf0b30430ca4128cc7cfafece0c274a118cd0cdb251049664ace0dee4ff"
extraMounts:
- containerPath: "/var/run/docker.sock"
hostPath: "/var/run/docker.sock"
Expand Down
14 changes: 0 additions & 14 deletions test/e2e/data/infrastructure-docker/v0.4/bases/mhc.yaml

This file was deleted.

43 changes: 0 additions & 43 deletions test/e2e/data/infrastructure-docker/v0.4/bases/mp.yaml

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
bases:
- ../bases/cluster-with-kcp.yaml
- ../bases/md.yaml
- ../bases/crs.yaml
- ../bases/mp.yaml
- ../bases/mhc.yaml
- ../bases/crs.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,8 @@ metadata:
spec:
template:
spec:
# NOTE: If the Kubernetes version is changed in `clusterctl_upgrade_test.go` the image and SHA must be updated here.
customImage: "kindest/node:v1.23.17@sha256:f77f8cf0b30430ca4128cc7cfafece0c274a118cd0cdb251049664ace0dee4ff"
extraMounts:
- containerPath: "/var/run/docker.sock"
hostPath: "/var/run/docker.sock"
Expand Down
2 changes: 2 additions & 0 deletions test/e2e/data/infrastructure-docker/v1.0/bases/md.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@ metadata:
spec:
template:
spec:
# NOTE: If the Kubernetes version is changed in `clusterctl_upgrade_test.go` the image and SHA must be updated here.
customImage: "kindest/node:v1.23.17@sha256:f77f8cf0b30430ca4128cc7cfafece0c274a118cd0cdb251049664ace0dee4ff"
extraMounts:
- containerPath: "/var/run/docker.sock"
hostPath: "/var/run/docker.sock"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,8 @@ metadata:
spec:
template:
spec:
# NOTE: If the Kubernetes version is changed in `clusterctl_upgrade_test.go` the image and SHA must be updated here.
customImage: "kindest/node:v1.26.4@sha256:f4c0d87be03d6bea69f5e5dc0adb678bb498a190ee5c38422bf751541cebe92e"
extraMounts:
- containerPath: "/var/run/docker.sock"
hostPath: "/var/run/docker.sock"
Expand Down
2 changes: 2 additions & 0 deletions test/e2e/data/infrastructure-docker/v1.3/bases/md.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@ metadata:
spec:
template:
spec:
# NOTE: If the Kubernetes version is changed in `clusterctl_upgrade_test.go` the image and SHA must be updated here.
customImage: "kindest/node:v1.26.4@sha256:f4c0d87be03d6bea69f5e5dc0adb678bb498a190ee5c38422bf751541cebe92e"
extraMounts:
- containerPath: "/var/run/docker.sock"
hostPath: "/var/run/docker.sock"
Expand Down
50 changes: 0 additions & 50 deletions test/e2e/data/infrastructure-docker/v1.3/bases/mp.yaml

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -181,33 +181,6 @@ spec:
valueFrom:
template: |
imageTag: {{ .coreDNSImageTag }}
- name: customImage
description: "Sets the container image that is used for running dockerMachines for the controlPlane and default-worker machineDeployments."
definitions:
- selector:
apiVersion: infrastructure.cluster.x-k8s.io/v1beta1
kind: DockerMachineTemplate
matchResources:
machineDeploymentClass:
names:
- default-worker
jsonPatches:
- op: add
path: "/spec/template/spec/customImage"
valueFrom:
template: |
kindest/node:{{ .builtin.machineDeployment.version | replace "+" "_" }}
- selector:
apiVersion: infrastructure.cluster.x-k8s.io/v1beta1
kind: DockerMachineTemplate
matchResources:
controlPlane: true
jsonPatches:
- op: add
path: "/spec/template/spec/customImage"
valueFrom:
template: |
kindest/node:{{ .builtin.controlPlane.version | replace "+" "_" }}
- name: preloadImages
description: |
Sets the container images to preload to the node that is used for running dockerMachines.
Expand Down Expand Up @@ -368,6 +341,8 @@ metadata:
spec:
template:
spec:
# NOTE: If the Kubernetes version is changed in `clusterctl_upgrade_test.go` the image and SHA must be updated here.
customImage: "kindest/node:v1.26.4@sha256:f4c0d87be03d6bea69f5e5dc0adb678bb498a190ee5c38422bf751541cebe92e"
extraMounts:
- containerPath: "/var/run/docker.sock"
hostPath: "/var/run/docker.sock"
Expand All @@ -379,6 +354,8 @@ metadata:
spec:
template:
spec:
# NOTE: If the Kubernetes version is changed in `clusterctl_upgrade_test.go` the image and SHA must be updated here.
customImage: "kindest/node:v1.26.4@sha256:f4c0d87be03d6bea69f5e5dc0adb678bb498a190ee5c38422bf751541cebe92e"
extraMounts:
- containerPath: "/var/run/docker.sock"
hostPath: "/var/run/docker.sock"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,8 @@ metadata:
spec:
template:
spec:
# NOTE: If the Kubernetes version is changed in `clusterctl_upgrade_test.go` the image and SHA must be updated here.
customImage: "kindest/node:v1.27.1@sha256:b7d12ed662b873bd8510879c1846e87c7e676a79fefc93e17b2a52989d3ff42b"
extraMounts:
- containerPath: "/var/run/docker.sock"
hostPath: "/var/run/docker.sock"
Expand Down
2 changes: 2 additions & 0 deletions test/e2e/data/infrastructure-docker/v1.4/bases/md.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@ metadata:
spec:
template:
spec:
# NOTE: If the Kubernetes version is changed in `clusterctl_upgrade_test.go` the image and SHA must be updated here.
customImage: "kindest/node:v1.27.1@sha256:b7d12ed662b873bd8510879c1846e87c7e676a79fefc93e17b2a52989d3ff42b"
extraMounts:
- containerPath: "/var/run/docker.sock"
hostPath: "/var/run/docker.sock"
Expand Down
Loading