Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
103 commits
Select commit Hold shift + click to select a range
1bd8a41
feat: upgrade cluster-api to v1.11.11 with v1beta2 types and contract
schegi Jun 12, 2026
b253498
chore: update e2e config, release metadata and compatibility matrix f…
schegi Jun 12, 2026
eec13a2
chore: upgrade to Go 1.26 and modernize code
schegi Jun 12, 2026
0ceace6
fix(ipam): guard against nil APIGroup when constructing IPPoolReference
schegi Jun 12, 2026
abf8534
fix(scope): patch cluster object even when SetSummaryCondition return…
schegi Jun 12, 2026
723d20f
fix(scope): patch machine object even when SetSummaryCondition return…
schegi Jun 12, 2026
27d107d
fix(scope): remove MachineProvisionedCondition from WithOwnedV1Beta1C…
schegi Jun 12, 2026
bb3e1f3
fix(server): add dedicated reason constant for MachineProvisioned con…
schegi Jun 12, 2026
cee4f58
fix(cluster-ctrl): add dedicated reason constant for IonosCloudCluste…
schegi Jun 12, 2026
af4c1ce
fix(controllers): add Message to all conditions.Set calls
schegi Jun 12, 2026
1edba25
refactor(ipam): extract shared TypedLocalObjectReference→IPPoolRefere…
schegi Jun 12, 2026
8b5f88a
refactor(scope): deduplicate condition type lists across WithOwnedV1B…
schegi Jun 12, 2026
6df8725
fix(server): use SetV1Beta1Ready helper instead of inline nil-guards
schegi Jun 12, 2026
a7a913e
fix(lint): resolve gci formatting and unused nolintlint directives
schegi Jun 13, 2026
9d8e08a
fix(main): extract duplicated error message literal into constant
schegi Jun 13, 2026
55e012f
fix(e2e): replace inline kind strings with existing constants
schegi Jun 13, 2026
baa2d5a
fix(conditions): clear message on True conditions to unblock Cluster.…
schegi Jun 13, 2026
1088f47
fix(v1beta2): change ProviderID to string and annotate CRDs with v1be…
schegi Jul 16, 2026
ea45eed
fix(build): bump builder image to golang:1.26.5
schegi Jul 16, 2026
26288e2
docs(spec): design for dropping v1beta1 (pure v1beta2 v0.8)
schegi Jul 17, 2026
4866f76
docs(plan): SP1 implementation plan for pure-v1beta2 clean cut
schegi Jul 17, 2026
ad24989
refactor: stop writing deprecated v1beta1 ready field
schegi Jul 17, 2026
3d60075
refactor(scope): drop v1beta1 condition ownership from patch calls
schegi Jul 17, 2026
7461324
test(api): remove deprecated v1beta1 condition tests
schegi Jul 17, 2026
45724ef
feat(api)!: remove deprecated v1beta1 status fields and helpers
schegi Jul 17, 2026
9bf2a99
feat(metadata): declare v1beta2 contract for v0.8
schegi Jul 17, 2026
4f3822b
docs: rewrite capi upgrade plan for pure-v1beta2 v0.8
schegi Jul 17, 2026
e1bf5fe
chore: address final review findings (README v0.7 row, dead lint alia…
schegi Jul 17, 2026
b5db700
fix(api): declare v1beta2 contract and backfill legacy condition reasons
schegi Jul 31, 2026
b1e7fc4
feat: upgrade cluster-api to v1.12.10
schegi Jul 31, 2026
e16c374
docs: add SP3 implementation plan for adopting the staged upgrade e2e…
schegi Jul 31, 2026
c268525
test(e2e): register CAPI v1.8.12/v1.10.10/v1.12.10 and CAPIC v0.6.3/v…
schegi Jul 31, 2026
5f5a499
test(e2e): add upgrade PostUpgrade assertion helpers for conditions m…
schegi Jul 31, 2026
1011626
test(e2e): add staged upgrade suite for conditions schema and CAPI v1…
schegi Jul 31, 2026
64690fc
ci(e2e): add scheduled upgrade e2e workflow and test-e2e-upgrade target
schegi Jul 31, 2026
e662368
fix(e2e): address final-review findings (scheme, provider versions, d…
schegi Jul 31, 2026
9cb6bb5
style(e2e): fix gci import ordering in upgrade_test.go
schegi Jul 31, 2026
d89c544
feat: upgrade cluster-api to v1.11.11 with v1beta2 types and contract
schegi Jun 12, 2026
b9ea15e
chore: update e2e config, release metadata and compatibility matrix f…
schegi Jun 12, 2026
14dfe62
chore: upgrade to Go 1.26 and modernize code
schegi Jun 12, 2026
e5cd0d8
fix(ipam): guard against nil APIGroup when constructing IPPoolReference
schegi Jun 12, 2026
d65b3a6
fix(scope): patch cluster object even when SetSummaryCondition return…
schegi Jun 12, 2026
c4da051
fix(scope): patch machine object even when SetSummaryCondition return…
schegi Jun 12, 2026
5c59aec
fix(scope): remove MachineProvisionedCondition from WithOwnedV1Beta1C…
schegi Jun 12, 2026
7822551
fix(server): add dedicated reason constant for MachineProvisioned con…
schegi Jun 12, 2026
b38f921
fix(cluster-ctrl): add dedicated reason constant for IonosCloudCluste…
schegi Jun 12, 2026
3024497
fix(controllers): add Message to all conditions.Set calls
schegi Jun 12, 2026
decaf51
refactor(ipam): extract shared TypedLocalObjectReference→IPPoolRefere…
schegi Jun 12, 2026
696d25a
refactor(scope): deduplicate condition type lists across WithOwnedV1B…
schegi Jun 12, 2026
45dfdc0
fix(server): use SetV1Beta1Ready helper instead of inline nil-guards
schegi Jun 12, 2026
82c6f10
fix(lint): resolve gci formatting and unused nolintlint directives
schegi Jun 13, 2026
86187cd
fix(main): extract duplicated error message literal into constant
schegi Jun 13, 2026
c3acc6b
fix(e2e): replace inline kind strings with existing constants
schegi Jun 13, 2026
ed9187f
fix(conditions): clear message on True conditions to unblock Cluster.…
schegi Jun 13, 2026
92f8328
fix(v1beta2): change ProviderID to string and annotate CRDs with v1be…
schegi Jul 16, 2026
04805f4
fix(build): bump builder image to golang:1.26.5
schegi Jul 16, 2026
b6dd0a1
docs(spec): design for dropping v1beta1 (pure v1beta2 v0.8)
schegi Jul 17, 2026
745f718
docs(plan): SP1 implementation plan for pure-v1beta2 clean cut
schegi Jul 17, 2026
924dd5c
refactor: stop writing deprecated v1beta1 ready field
schegi Jul 17, 2026
7051468
refactor(scope): drop v1beta1 condition ownership from patch calls
schegi Jul 17, 2026
c8bd0f0
test(api): remove deprecated v1beta1 condition tests
schegi Jul 17, 2026
c80dcb9
feat(api)!: remove deprecated v1beta1 status fields and helpers
schegi Jul 17, 2026
f18c283
feat(metadata): declare v1beta2 contract for v0.8
schegi Jul 17, 2026
6e59e1d
docs: rewrite capi upgrade plan for pure-v1beta2 v0.8
schegi Jul 17, 2026
1d25d7f
chore: address final review findings (README v0.7 row, dead lint alia…
schegi Jul 17, 2026
6805dcb
fix(api): declare v1beta2 contract and backfill legacy condition reasons
schegi Jul 31, 2026
f2864f6
fix(deps): bump golang.org/x/text and google.golang.org/grpc
schegi Jul 31, 2026
ccd762a
fix(e2e): bump ionoscloud provider version to v0.8.99
schegi Jul 31, 2026
075a0d3
fix: increase wait period for IONOS resources to become stable. Only …
mneverov Aug 12, 2026
5c91eaa
Merge branch 'feat/upgrade-cluster-api-v1.11.11' into feat/upgrade-cl…
mneverov Aug 12, 2026
0934f94
fix: go mod tidy
mneverov Aug 12, 2026
3ef274b
fix: drop AI instructions + superpowers
mneverov Aug 12, 2026
e130bd3
fix: reverted CRDMigrationPhases description
mneverov Aug 12, 2026
0bbd0d2
fix: owner reference relationships link
mneverov Aug 12, 2026
8b41ced
fix: use constants intstead of string
mneverov Aug 12, 2026
79a6ebe
fix: add useful linter comments back
mneverov Aug 12, 2026
fa3cd6c
chore: bump nextVersion
mneverov Aug 13, 2026
201cb11
Revert "chore: bump nextVersion"
mneverov Aug 20, 2026
8a115e4
chore: bump go version
mneverov Aug 20, 2026
3c2cf01
chore: bump go version in docker
mneverov Aug 20, 2026
b65735a
validate skipCRDMigrationphases
WassimKallel Sep 21, 2026
ba2c308
fix(deps): bump google.golang.org/grpc to v1.83.2
WassimKallel Sep 21, 2026
c795570
Merge feat/upgrade-cluster-api-v1.11.11 into feat/upgrade-cluster-api…
WassimKallel Sep 21, 2026
a7f007b
refactor: use util.IsControlPlaneMachine instead of a local copy
WassimKallel Sep 22, 2026
1da553e
fix(api): drop the controlPlaneEndpoint CEL rule broken by v1beta2
WassimKallel Sep 22, 2026
bdb9edb
fix(e2e): actually use wait-resource-versions-become-stable
WassimKallel Sep 22, 2026
e46f0bd
test(api): update port validation test for v1beta2 semantics
WassimKallel Sep 22, 2026
f81c21a
fix(scope): log the summary condition error instead of returning it
WassimKallel Sep 22, 2026
8d4f16a
Merge remote-tracking branch 'origin/feat/upgrade-cluster-api-v1.11.1…
WassimKallel Sep 22, 2026
67a6a51
Merge main into feat/upgrade-cluster-api-v1.12.10
WassimKallel Sep 22, 2026
a3d2a1e
fix(deps): bump cel-go and otel to clear open Dependabot alerts
WassimKallel Sep 22, 2026
51c2bb7
ci: pin trivy-action to a commit SHA
WassimKallel Sep 22, 2026
dc94699
ci: bump trivy-action to v0.36.0
WassimKallel Sep 22, 2026
bb41e7a
fix(e2e): split the management cluster version from the workload version
WassimKallel Sep 22, 2026
6ffb1a7
Merge feat/upgrade-cluster-api-v1.12.10 into feat/upgrade-e2e-suite
WassimKallel Sep 22, 2026
1244ab5
fix(e2e): add the upgrade intervals, align action versions, drop the …
WassimKallel Sep 22, 2026
3dc0ab4
chore: trim overlong comments
WassimKallel Sep 22, 2026
179280b
Merge base and trim comments
WassimKallel Sep 22, 2026
60bce03
Update test/e2e/config/ionoscloud.yaml
WassimKallel Sep 23, 2026
72502e8
test(e2e): bump workload KUBERNETES_VERSION to v1.34.11
WassimKallel Sep 23, 2026
d24b18e
Merge branch 'feat/upgrade-cluster-api-v1.12.10' into feat/upgrade-e2…
WassimKallel Sep 23, 2026
f939cb4
Merge branch 'main' into feat/upgrade-e2e-suite
WassimKallel Sep 23, 2026
fc3eade
Merge branch 'main' into feat/upgrade-e2e-suite
WassimKallel Sep 30, 2026
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
37 changes: 37 additions & 0 deletions .github/workflows/e2e-upgrade.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
name: End-to-end upgrade tests
on:
schedule:
# Weekly, matching the conformance suite's cadence. Offset to Tuesday to
# avoid contending for IONOS Cloud resources with conformance (Mondays).
- cron: "0 5 * * 2"
workflow_dispatch: {}
jobs:
e2e-upgrade:
runs-on: ubuntu-latest
environment: e2e
env:
IONOS_TOKEN: ${{ secrets.IONOS_TOKEN }}
IONOSCLOUD_MACHINE_IMAGE_ID: ${{ vars.IONOSCLOUD_MACHINE_IMAGE_ID }}
CONTROL_PLANE_ENDPOINT_LOCATION: ${{ vars.CONTROL_PLANE_ENDPOINT_LOCATION }}
IONOSCLOUD_CUBE_TEMPLATE_ID: ${{ vars.IONOSCLOUD_CUBE_TEMPLATE_ID }}
# Real IONOS Cloud cluster provisioning across multiple upgrade hops is very
# likely to exceed the Makefile's 2h default; override for this scheduled run.
GINKGO_TIMEOUT: "4h"
steps:
- uses: actions/checkout@v7

- name: Setup Go environment
uses: actions/setup-go@v7
with:
go-version-file: "go.mod"

- name: Run e2e upgrade tests

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

This provisions real IONOS infra the same way e2e.yaml does, but we don't carry over the cancellation-cleanup step (id: tests + make remove-cancelled-e2e-leftovers on if: cancelled()). Without it, a cancelled or timed-out run here leaves the datacenter/IP block behind.

run: make test-e2e-upgrade

- name: Upload artifacts
uses: actions/upload-artifact@v7
if: success() || failure()
with:
name: logs-upgrade
path: _artifacts
retention-days: 7
Comment on lines +28 to +37
15 changes: 14 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -284,7 +284,10 @@ GINKGO_NODES ?= 1
GINKGO_FOCUS ?=
GINKGO_TIMEOUT ?= 2h
GINKGO_NOCOLOR ?= false
GINKGO_LABEL ?= "!Conformance"
# Exclude the "upgrade" label by default: the provider-upgrade suite is heavy
# (spins up its own kind management cluster and installs old providers per block)
# and is run separately via `make test-e2e-upgrade`.
GINKGO_LABEL ?= "!Conformance && !upgrade"

GINKGO_SKIP ?=
# To set multiple ginkgo skip flags, if any
Expand All @@ -306,6 +309,16 @@ test-e2e: docker-build-e2e ## Run the end-to-end tests
-e2e.artifacts-folder="$(ARTIFACTS)" -e2e.config="$(E2E_CONF_FILE)" \
-e2e.skip-resource-cleanup=$(SKIP_RESOURCE_CLEANUP) -e2e.use-existing-cluster=$(USE_EXISTING_CLUSTER)

.PHONY: test-e2e-upgrade
test-e2e-upgrade: docker-build-e2e ## Run only the provider-upgrade e2e tests (Label "upgrade")

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

test-e2e forwards GINKGO_FOCUS/GINKGO_SKIP but this target drops both. Anyone trying to isolate one upgrade hop with GINKGO_FOCUS will silently run both Describe blocks instead, which is expensive given these provision real cloud resources.

CGO_ENABLED=1 go run github.com/onsi/ginkgo/v2/ginkgo -v --trace \
-poll-progress-after=$(GINKGO_POLL_PROGRESS_AFTER) \
-poll-progress-interval=$(GINKGO_POLL_PROGRESS_INTERVAL) --tags=e2e --fail-fast \
--nodes=1 --label-filter="upgrade" --timeout=$(GINKGO_TIMEOUT) --no-color=$(GINKGO_NOCOLOR) \
--output-dir="$(ARTIFACTS)" --junit-report="junit.e2e_upgrade.1.xml" $(GINKGO_ARGS) $(ROOT_DIR)/$(TEST_DIR)/e2e -- \
-e2e.artifacts-folder="$(ARTIFACTS)" -e2e.config="$(E2E_CONF_FILE)" \
-e2e.skip-resource-cleanup=$(SKIP_RESOURCE_CLEANUP) -e2e.use-existing-cluster=$(USE_EXISTING_CLUSTER)

.PHONY: ionosctl
ionosctl: $(LOCALBIN) ## Download the latest release of ionosctl and add to the bin folder
@if [ ! -f $(LOCALBIN)/ionosctl ]; then \
Expand Down
130 changes: 130 additions & 0 deletions test/e2e/config/ionoscloud.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,42 @@ providers:
new: --metrics-addr=:8443
files:
- sourcePath: "../data/shared/v1.13/metadata.yaml"
- name: "v1.12.10"
value: "https://github.com/kubernetes-sigs/cluster-api/releases/download/v1.12.10/core-components.yaml"
type: url
contract: v1beta2
replacements:
- old: --metrics-addr=127.0.0.1:8080
new: --metrics-addr=:8443
files:
- sourcePath: "../data/shared/v1.12/metadata.yaml"
- name: "v1.11.11"
value: "https://github.com/kubernetes-sigs/cluster-api/releases/download/v1.11.11/core-components.yaml"
type: url
contract: v1beta2
replacements:
- old: --metrics-addr=127.0.0.1:8080
new: --metrics-addr=:8443
files:
- sourcePath: "../data/shared/v1.11/metadata.yaml"
- name: "v1.10.10"
value: "https://github.com/kubernetes-sigs/cluster-api/releases/download/v1.10.10/core-components.yaml"
type: url
contract: v1beta1
replacements:
- old: --metrics-addr=127.0.0.1:8080
new: --metrics-addr=:8443
files:
- sourcePath: "../data/shared/v1.10/metadata.yaml"
- name: "v1.8.12"
value: "https://github.com/kubernetes-sigs/cluster-api/releases/download/v1.8.12/core-components.yaml"
type: url
contract: v1beta1
replacements:
- old: --metrics-addr=127.0.0.1:8080
new: --metrics-addr=:8443
files:
- sourcePath: "../data/shared/v1.8/metadata.yaml"
- name: kubeadm
type: BootstrapProvider
versions:
Expand All @@ -26,6 +62,42 @@ providers:
new: --metrics-addr=:8443
files:
- sourcePath: "../data/shared/v1.13/metadata.yaml"
- name: "v1.12.10"
value: "https://github.com/kubernetes-sigs/cluster-api/releases/download/v1.12.10/bootstrap-components.yaml"
type: url
contract: v1beta2
replacements:
- old: --metrics-addr=127.0.0.1:8080
new: --metrics-addr=:8443
files:
- sourcePath: "../data/shared/v1.12/metadata.yaml"
- name: "v1.11.11"
value: "https://github.com/kubernetes-sigs/cluster-api/releases/download/v1.11.11/bootstrap-components.yaml"
type: url
contract: v1beta2
replacements:
- old: --metrics-addr=127.0.0.1:8080
new: --metrics-addr=:8443
files:
- sourcePath: "../data/shared/v1.11/metadata.yaml"
- name: "v1.10.10"
value: "https://github.com/kubernetes-sigs/cluster-api/releases/download/v1.10.10/bootstrap-components.yaml"
type: url
contract: v1beta1
replacements:
- old: --metrics-addr=127.0.0.1:8080
new: --metrics-addr=:8443
files:
- sourcePath: "../data/shared/v1.10/metadata.yaml"
- name: "v1.8.12"
value: "https://github.com/kubernetes-sigs/cluster-api/releases/download/v1.8.12/bootstrap-components.yaml"
type: url
contract: v1beta1
replacements:
- old: --metrics-addr=127.0.0.1:8080
new: --metrics-addr=:8443
files:
- sourcePath: "../data/shared/v1.8/metadata.yaml"
- name: kubeadm
type: ControlPlaneProvider
versions:
Expand All @@ -38,6 +110,42 @@ providers:
new: --metrics-addr=:8443
files:
- sourcePath: "../data/shared/v1.13/metadata.yaml"
- name: "v1.12.10"
value: "https://github.com/kubernetes-sigs/cluster-api/releases/download/v1.12.10/control-plane-components.yaml"
type: url
contract: v1beta2
replacements:
- old: --metrics-addr=127.0.0.1:8080
new: --metrics-addr=:8443
files:
- sourcePath: "../data/shared/v1.12/metadata.yaml"
- name: "v1.11.11"
value: "https://github.com/kubernetes-sigs/cluster-api/releases/download/v1.11.11/control-plane-components.yaml"
type: url
contract: v1beta2
replacements:
- old: --metrics-addr=127.0.0.1:8080
new: --metrics-addr=:8443
files:
- sourcePath: "../data/shared/v1.11/metadata.yaml"
- name: "v1.10.10"
value: "https://github.com/kubernetes-sigs/cluster-api/releases/download/v1.10.10/control-plane-components.yaml"
type: url
contract: v1beta1
replacements:
- old: --metrics-addr=127.0.0.1:8080
new: --metrics-addr=:8443
files:
- sourcePath: "../data/shared/v1.10/metadata.yaml"
- name: "v1.8.12"
value: "https://github.com/kubernetes-sigs/cluster-api/releases/download/v1.8.12/control-plane-components.yaml"
type: url
contract: v1beta1
replacements:
- old: --metrics-addr=127.0.0.1:8080
new: --metrics-addr=:8443
files:
- sourcePath: "../data/shared/v1.8/metadata.yaml"
- name: in-cluster
type: IPAMProvider
versions:
Expand All @@ -54,6 +162,22 @@ providers:
- name: ionoscloud
type: InfrastructureProvider
versions:
- name: v0.6.3
value: "https://github.com/ionos-cloud/cluster-api-provider-ionoscloud/releases/download/v0.6.3/infrastructure-components.yaml"
type: url
contract: v1beta1
files:
- sourcePath: "../data/infrastructure-ionoscloud/cluster-template.yaml"
- name: v0.7.0
value: "https://github.com/ionos-cloud/cluster-api-provider-ionoscloud/releases/download/v0.7.0/infrastructure-components.yaml"
type: url
contract: v1beta1
files:
# The published v0.7.0 metadata.yaml is missing its own "0.7" releaseSeries
# entry, so clusterctl can't resolve the version's contract and init fails.
# Override it with the repo metadata.yaml, which declares 0.7 as v1beta1.
- sourcePath: "../../../metadata.yaml"
- sourcePath: "../data/infrastructure-ionoscloud/cluster-template.yaml"
- name: v0.8.99
value: "../../../config/default"
Comment on lines 181 to 182
replacements:
Expand All @@ -73,6 +197,7 @@ variables:
# This avoids building node images in the default case which improves the test duration significantly.
# Workload version: must match the IONOS node image (IONOSCLOUD_MACHINE_IMAGE_ID).
KUBERNETES_VERSION: "v1.34.11"
IP_FAMILY: "ipv4"
# Management (kind) version: must be in CAPI's supported management range, v1.32-v1.36 for v1.13.
KUBERNETES_VERSION_MANAGEMENT: "v1.33.7"
CNI: "./data/cni/calico.yaml"
Expand All @@ -98,6 +223,11 @@ intervals:
default/wait-delete-cluster: [ "30m", "10s" ]
default/wait-nodes-ready: ["30m", "10s"]
default/wait-resource-versions-become-stable: ["5m", "10s"]
# Upgrade spec intervals; values match upstream's docker.yaml. A missing key yields nil,
# which Eventually treats as Gomega's ~1s default.
default/wait-resource-versions-remain-stable: ["2m", "5s"]
default/wait-control-plane-upgrade: ["15m", "10s"]
default/wait-machine-deployment-upgrade: ["10m", "10s"]
scale/wait-cluster: ["30m", "10s"]
scale/wait-control-plane: ["30m", "10s"]
scale/wait-worker-nodes: ["30m", "10s"]
52 changes: 52 additions & 0 deletions test/e2e/helpers/clusterhealth.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
//go:build e2e

/*
Copyright 2024 IONOS Cloud.

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/

package helpers

import (
"context"

clusterv1beta1 "sigs.k8s.io/cluster-api/api/core/v1beta1" //nolint:staticcheck // only contract CAPI v1.10.x serves
"sigs.k8s.io/cluster-api/test/framework"
runtimeclient "sigs.k8s.io/controller-runtime/pkg/client"

. "github.com/onsi/gomega"
)

// AssertV1Beta1ClusterAndMachinesHealthy is a PostUpgrade hook checking Cluster/Machine
// Status.Phase only — safe to use when the upgrade target doesn't serve v1beta2 yet.
func AssertV1Beta1ClusterAndMachinesHealthy(ctx context.Context) func(framework.ClusterProxy, string, string) {
return func(proxy framework.ClusterProxy, namespace, clusterName string) {
c := proxy.GetClient()

cluster := &clusterv1beta1.Cluster{}
Expect(c.Get(ctx, runtimeclient.ObjectKey{Namespace: namespace, Name: clusterName}, cluster)).To(Succeed())
Expect(cluster.Status.Phase).To(Equal(string(clusterv1beta1.ClusterPhaseProvisioned)),
"Cluster %s should be in the Provisioned phase", clusterName)

machines := &clusterv1beta1.MachineList{}
Expect(c.List(ctx, machines, runtimeclient.InNamespace(namespace),
runtimeclient.MatchingLabels{clusterv1beta1.ClusterNameLabel: clusterName})).To(Succeed())
Expect(machines.Items).NotTo(BeEmpty(), "expected at least one Machine for cluster %s", clusterName)

for _, m := range machines.Items {
Expect(m.Status.Phase).To(Equal(string(clusterv1beta1.MachinePhaseRunning)),
"Machine %s should be in the Running phase", m.Name)
}
}
}
Loading
Loading