Repository navigation
test(e2e): add upgrade test suite for CAPI v1beta2 and conditions migration #379
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
Closed
Closed
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 b253498
chore: update e2e config, release metadata and compatibility matrix f…
schegi eec13a2
chore: upgrade to Go 1.26 and modernize code
schegi 0ceace6
fix(ipam): guard against nil APIGroup when constructing IPPoolReference
schegi abf8534
fix(scope): patch cluster object even when SetSummaryCondition return…
schegi 723d20f
fix(scope): patch machine object even when SetSummaryCondition return…
schegi 27d107d
fix(scope): remove MachineProvisionedCondition from WithOwnedV1Beta1C…
schegi bb3e1f3
fix(server): add dedicated reason constant for MachineProvisioned con…
schegi cee4f58
fix(cluster-ctrl): add dedicated reason constant for IonosCloudCluste…
schegi af4c1ce
fix(controllers): add Message to all conditions.Set calls
schegi 1edba25
refactor(ipam): extract shared TypedLocalObjectReference→IPPoolRefere…
schegi 8b5f88a
refactor(scope): deduplicate condition type lists across WithOwnedV1B…
schegi 6df8725
fix(server): use SetV1Beta1Ready helper instead of inline nil-guards
schegi a7a913e
fix(lint): resolve gci formatting and unused nolintlint directives
schegi 9d8e08a
fix(main): extract duplicated error message literal into constant
schegi 55e012f
fix(e2e): replace inline kind strings with existing constants
schegi baa2d5a
fix(conditions): clear message on True conditions to unblock Cluster.…
schegi 1088f47
fix(v1beta2): change ProviderID to string and annotate CRDs with v1be…
schegi ea45eed
fix(build): bump builder image to golang:1.26.5
schegi 26288e2
docs(spec): design for dropping v1beta1 (pure v1beta2 v0.8)
schegi 4866f76
docs(plan): SP1 implementation plan for pure-v1beta2 clean cut
schegi ad24989
refactor: stop writing deprecated v1beta1 ready field
schegi 3d60075
refactor(scope): drop v1beta1 condition ownership from patch calls
schegi 7461324
test(api): remove deprecated v1beta1 condition tests
schegi 45724ef
feat(api)!: remove deprecated v1beta1 status fields and helpers
schegi 9bf2a99
feat(metadata): declare v1beta2 contract for v0.8
schegi 4f3822b
docs: rewrite capi upgrade plan for pure-v1beta2 v0.8
schegi e1bf5fe
chore: address final review findings (README v0.7 row, dead lint alia…
schegi b5db700
fix(api): declare v1beta2 contract and backfill legacy condition reasons
schegi b1e7fc4
feat: upgrade cluster-api to v1.12.10
schegi e16c374
docs: add SP3 implementation plan for adopting the staged upgrade e2e…
schegi c268525
test(e2e): register CAPI v1.8.12/v1.10.10/v1.12.10 and CAPIC v0.6.3/v…
schegi 5f5a499
test(e2e): add upgrade PostUpgrade assertion helpers for conditions m…
schegi 1011626
test(e2e): add staged upgrade suite for conditions schema and CAPI v1…
schegi 64690fc
ci(e2e): add scheduled upgrade e2e workflow and test-e2e-upgrade target
schegi e662368
fix(e2e): address final-review findings (scheme, provider versions, d…
schegi 9cb6bb5
style(e2e): fix gci import ordering in upgrade_test.go
schegi d89c544
feat: upgrade cluster-api to v1.11.11 with v1beta2 types and contract
schegi b9ea15e
chore: update e2e config, release metadata and compatibility matrix f…
schegi 14dfe62
chore: upgrade to Go 1.26 and modernize code
schegi e5cd0d8
fix(ipam): guard against nil APIGroup when constructing IPPoolReference
schegi d65b3a6
fix(scope): patch cluster object even when SetSummaryCondition return…
schegi c4da051
fix(scope): patch machine object even when SetSummaryCondition return…
schegi 5c59aec
fix(scope): remove MachineProvisionedCondition from WithOwnedV1Beta1C…
schegi 7822551
fix(server): add dedicated reason constant for MachineProvisioned con…
schegi b38f921
fix(cluster-ctrl): add dedicated reason constant for IonosCloudCluste…
schegi 3024497
fix(controllers): add Message to all conditions.Set calls
schegi decaf51
refactor(ipam): extract shared TypedLocalObjectReference→IPPoolRefere…
schegi 696d25a
refactor(scope): deduplicate condition type lists across WithOwnedV1B…
schegi 45dfdc0
fix(server): use SetV1Beta1Ready helper instead of inline nil-guards
schegi 82c6f10
fix(lint): resolve gci formatting and unused nolintlint directives
schegi 86187cd
fix(main): extract duplicated error message literal into constant
schegi c3acc6b
fix(e2e): replace inline kind strings with existing constants
schegi ed9187f
fix(conditions): clear message on True conditions to unblock Cluster.…
schegi 92f8328
fix(v1beta2): change ProviderID to string and annotate CRDs with v1be…
schegi 04805f4
fix(build): bump builder image to golang:1.26.5
schegi b6dd0a1
docs(spec): design for dropping v1beta1 (pure v1beta2 v0.8)
schegi 745f718
docs(plan): SP1 implementation plan for pure-v1beta2 clean cut
schegi 924dd5c
refactor: stop writing deprecated v1beta1 ready field
schegi 7051468
refactor(scope): drop v1beta1 condition ownership from patch calls
schegi c8bd0f0
test(api): remove deprecated v1beta1 condition tests
schegi c80dcb9
feat(api)!: remove deprecated v1beta1 status fields and helpers
schegi f18c283
feat(metadata): declare v1beta2 contract for v0.8
schegi 6e59e1d
docs: rewrite capi upgrade plan for pure-v1beta2 v0.8
schegi 1d25d7f
chore: address final review findings (README v0.7 row, dead lint alia…
schegi 6805dcb
fix(api): declare v1beta2 contract and backfill legacy condition reasons
schegi f2864f6
fix(deps): bump golang.org/x/text and google.golang.org/grpc
schegi ccd762a
fix(e2e): bump ionoscloud provider version to v0.8.99
schegi 075a0d3
fix: increase wait period for IONOS resources to become stable. Only …
mneverov 5c91eaa
Merge branch 'feat/upgrade-cluster-api-v1.11.11' into feat/upgrade-cl…
mneverov 0934f94
fix: go mod tidy
mneverov 3ef274b
fix: drop AI instructions + superpowers
mneverov e130bd3
fix: reverted CRDMigrationPhases description
mneverov 0bbd0d2
fix: owner reference relationships link
mneverov 8b41ced
fix: use constants intstead of string
mneverov 79a6ebe
fix: add useful linter comments back
mneverov fa3cd6c
chore: bump nextVersion
mneverov 201cb11
Revert "chore: bump nextVersion"
mneverov 8a115e4
chore: bump go version
mneverov 3c2cf01
chore: bump go version in docker
mneverov b65735a
validate skipCRDMigrationphases
WassimKallel ba2c308
fix(deps): bump google.golang.org/grpc to v1.83.2
WassimKallel c795570
Merge feat/upgrade-cluster-api-v1.11.11 into feat/upgrade-cluster-api…
WassimKallel a7f007b
refactor: use util.IsControlPlaneMachine instead of a local copy
WassimKallel 1da553e
fix(api): drop the controlPlaneEndpoint CEL rule broken by v1beta2
WassimKallel bdb9edb
fix(e2e): actually use wait-resource-versions-become-stable
WassimKallel e46f0bd
test(api): update port validation test for v1beta2 semantics
WassimKallel f81c21a
fix(scope): log the summary condition error instead of returning it
WassimKallel 8d4f16a
Merge remote-tracking branch 'origin/feat/upgrade-cluster-api-v1.11.1…
WassimKallel 67a6a51
Merge main into feat/upgrade-cluster-api-v1.12.10
WassimKallel a3d2a1e
fix(deps): bump cel-go and otel to clear open Dependabot alerts
WassimKallel 51c2bb7
ci: pin trivy-action to a commit SHA
WassimKallel dc94699
ci: bump trivy-action to v0.36.0
WassimKallel bb41e7a
fix(e2e): split the management cluster version from the workload version
WassimKallel 6ffb1a7
Merge feat/upgrade-cluster-api-v1.12.10 into feat/upgrade-e2e-suite
WassimKallel 1244ab5
fix(e2e): add the upgrade intervals, align action versions, drop the …
WassimKallel 3dc0ab4
chore: trim overlong comments
WassimKallel 179280b
Merge base and trim comments
WassimKallel 60bce03
Update test/e2e/config/ionoscloud.yaml
WassimKallel 72502e8
test(e2e): bump workload KUBERNETES_VERSION to v1.34.11
WassimKallel d24b18e
Merge branch 'feat/upgrade-cluster-api-v1.12.10' into feat/upgrade-e2…
WassimKallel f939cb4
Merge branch 'main' into feat/upgrade-e2e-suite
WassimKallel fc3eade
Merge branch 'main' into feat/upgrade-e2e-suite
WassimKallel File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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 | ||
| 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
|
||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -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 | ||
|
|
@@ -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") | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe 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 \ | ||
|
|
||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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) | ||
| } | ||
| } | ||
| } |
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
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-leftoversonif: cancelled()). Without it, a cancelled or timed-out run here leaves the datacenter/IP block behind.