Skip to content

feat(byot): assert post-adoption talos upgrade flow in integration tests - #494

Open
Paul Thuriot (pthuriot-corti) wants to merge 1 commit into
mainfrom
test/byot-talos-upgrade-flow
Open

Paul Thuriot (pthuriot-corti) wants to merge 1 commit into
mainfrom
test/byot-talos-upgrade-flow

Conversation

@pthuriot-corti

Copy link
Copy Markdown
Contributor

Add upgrade-status helpers (GetByotMachineUpgradeStatus, WaitForByotMachineUpgradeComplete, InstallerTagFromRef, GetByotTalosImageName) and parameterize startByotHosts with the boot Talos version.

TestByotClusterFreshAdopt now asserts every ByotMachine reaches TalosVersionReady=True/Upgraded (the upgrade the merged talos.version wiring enables via desiredTalosVersion) before the node-count check, so a failed upgrade surfaces with its reason instead of an opaque timeout.

New TestByotClusterTalosUpgrade boots maintenance containers at v1.13.0 and asserts the chart target (talos.imageName, v1.13.8) moves status.currentTalosVersion to the target tag — proving a real version change, not a same-version reinstall.

Signed-off-by: Paul Thuriot pth@corti.ai

Copilot AI lite review requested due to automatic review settings September 11, 2026 11:23

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🟡 Changes recommended

Upgrade polling does not yet surface failure reasons and can abort on transient status gaps.

Once you've addressed the issues Copilot identified, you can request another Copilot review.

Pull request overview

Adds BYOT Talos upgrade-status helpers and integration coverage for real post-adoption upgrades.

Changes:

  • Adds upgrade polling and image-reference helpers.
  • Parameterizes boot Talos versions.
  • Adds fresh-adoption and Talos upgrade assertions.
File summaries
File Reviewed changes
pkg/test/helpers/byothelpers.go Adds upgrade status parsing and completion polling.
pkg/test/byot_test.go Adds BYOT upgrade integration coverage.
Review details

Suppressed comments (1)

pkg/test/helpers/byothelpers.go:668

  • This calls ByotMachineConditionState from inside a polling closure, but that accessor uses require.True when status.conditions is not present and require.NoError for a transient GET failure. A newly claimed ByotMachine can still be between creation and its first status update, so the first poll can abort the test instead of retrying; the existing byotMachineConditionCheck already treats those states as “not ready”. Use that tolerant check here, or make the accessor return Unknown/retryable results rather than failing the test.
		condStatus, reason := ByotMachineConditionState(
			ctx, t, env, namespace, machineName, ByotMachineConditionTalosVersionReady)
		if condStatus != corev1.ConditionTrue || reason != ByotUpgradeReasonUpgraded {
  • Files reviewed: 2/2 changed files
  • Comments generated: 1
  • Review effort level: Lite

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment thread pkg/test/helpers/byothelpers.go Outdated
Comment on lines +662 to +664
if status.UpgradeState != "" {
return false, nil // still in flight or failed
}
@github-actions

github-actions Bot commented Sep 11, 2026

Copy link
Copy Markdown
Go test coverage: 22.7% for commit 030ec73
⚠️ 43 of 56 packages have zero coverage.
  • github.com/kommodity-io/kommodity/cmd/kommodity
  • github.com/kommodity-io/kommodity/pkg/attestation
  • github.com/kommodity-io/kommodity/pkg/attestation/rest
  • github.com/kommodity-io/kommodity/pkg/attestation/rest/nonce
  • github.com/kommodity-io/kommodity/pkg/attestation/rest/report
  • github.com/kommodity-io/kommodity/pkg/attestation/rest/trust
  • github.com/kommodity-io/kommodity/pkg/combinedserver
  • github.com/kommodity-io/kommodity/pkg/config
  • github.com/kommodity-io/kommodity/pkg/controller/index
  • github.com/kommodity-io/kommodity/pkg/controller/webhook
  • github.com/kommodity-io/kommodity/pkg/kine
  • github.com/kommodity-io/kommodity/pkg/logging/example
  • github.com/kommodity-io/kommodity/pkg/metadata
  • github.com/kommodity-io/kommodity/pkg/metadata/rest/userdata
  • github.com/kommodity-io/kommodity/pkg/net
  • github.com/kommodity-io/kommodity/pkg/openapi
  • github.com/kommodity-io/kommodity/pkg/openapi/admissionregistration
  • github.com/kommodity-io/kommodity/pkg/openapi/apiextensions
  • github.com/kommodity-io/kommodity/pkg/openapi/apiregistration
  • github.com/kommodity-io/kommodity/pkg/openapi/audit
  • github.com/kommodity-io/kommodity/pkg/openapi/authorization
  • github.com/kommodity-io/kommodity/pkg/openapi/core
  • github.com/kommodity-io/kommodity/pkg/openapi/intstr
  • github.com/kommodity-io/kommodity/pkg/openapi/meta
  • github.com/kommodity-io/kommodity/pkg/openapi/rbac
  • github.com/kommodity-io/kommodity/pkg/openapi/runtime
  • github.com/kommodity-io/kommodity/pkg/openapi/storage
  • github.com/kommodity-io/kommodity/pkg/openapi/version
  • github.com/kommodity-io/kommodity/pkg/provider
  • github.com/kommodity-io/kommodity/pkg/storage
  • github.com/kommodity-io/kommodity/pkg/storage/configmaps
  • github.com/kommodity-io/kommodity/pkg/storage/endpoints
  • github.com/kommodity-io/kommodity/pkg/storage/events
  • github.com/kommodity-io/kommodity/pkg/storage/namespaces
  • github.com/kommodity-io/kommodity/pkg/storage/rbac
  • github.com/kommodity-io/kommodity/pkg/storage/secrets
  • github.com/kommodity-io/kommodity/pkg/storage/selfsubjectaccessreviews
  • github.com/kommodity-io/kommodity/pkg/storage/serviceaccount
  • github.com/kommodity-io/kommodity/pkg/storage/services
  • github.com/kommodity-io/kommodity/pkg/storage/storage
  • github.com/kommodity-io/kommodity/pkg/storage/webhookconfigurations
  • github.com/kommodity-io/kommodity/pkg/ui
  • github.com/kommodity-io/kommodity/pkg/ui/api
View coverage for all packages
# Package Name                                                           | Coverage
- github.com/kommodity-io/kommodity/cmd/kommodity                        |     0.0%
- github.com/kommodity-io/kommodity/pkg/attestation                      |     0.0%
- github.com/kommodity-io/kommodity/pkg/attestation/rest                 |     0.0%
- github.com/kommodity-io/kommodity/pkg/attestation/rest/nonce           |     0.0%
- github.com/kommodity-io/kommodity/pkg/attestation/rest/report          |     0.0%
- github.com/kommodity-io/kommodity/pkg/attestation/rest/trust           |     0.0%
- github.com/kommodity-io/kommodity/pkg/combinedserver                   |     0.0%
- github.com/kommodity-io/kommodity/pkg/config                           |     0.0%
+ github.com/kommodity-io/kommodity/pkg/controller                       |    17.2%
- github.com/kommodity-io/kommodity/pkg/controller/index                 |     0.0%
+ github.com/kommodity-io/kommodity/pkg/controller/reconciler            |    11.9%
+ github.com/kommodity-io/kommodity/pkg/controller/reconciler/azurearm   |    31.4%
- github.com/kommodity-io/kommodity/pkg/controller/webhook               |     0.0%
- github.com/kommodity-io/kommodity/pkg/kine                             |     0.0%
+ github.com/kommodity-io/kommodity/pkg/kms                              |    41.8%
+ github.com/kommodity-io/kommodity/pkg/libkapi                          |    74.0%
+ github.com/kommodity-io/kommodity/pkg/libkapi/apiserver                |    83.8%
+ github.com/kommodity-io/kommodity/pkg/libkapi/auth                     |    78.6%
+ github.com/kommodity-io/kommodity/pkg/libkapi/controllers              |    28.6%
+ github.com/kommodity-io/kommodity/pkg/libkapi/logging                  |    94.0%
+ github.com/kommodity-io/kommodity/pkg/libkapi/storage                  |    71.2%
+ github.com/kommodity-io/kommodity/pkg/logging                          |    75.0%
- github.com/kommodity-io/kommodity/pkg/logging/example                  |     0.0%
- github.com/kommodity-io/kommodity/pkg/metadata                         |     0.0%
- github.com/kommodity-io/kommodity/pkg/metadata/rest/userdata           |     0.0%
- github.com/kommodity-io/kommodity/pkg/net                              |     0.0%
- github.com/kommodity-io/kommodity/pkg/openapi                          |     0.0%
- github.com/kommodity-io/kommodity/pkg/openapi/admissionregistration    |     0.0%
- github.com/kommodity-io/kommodity/pkg/openapi/apiextensions            |     0.0%
- github.com/kommodity-io/kommodity/pkg/openapi/apiregistration          |     0.0%
- github.com/kommodity-io/kommodity/pkg/openapi/audit                    |     0.0%
- github.com/kommodity-io/kommodity/pkg/openapi/authorization            |     0.0%
- github.com/kommodity-io/kommodity/pkg/openapi/core                     |     0.0%
- github.com/kommodity-io/kommodity/pkg/openapi/intstr                   |     0.0%
- github.com/kommodity-io/kommodity/pkg/openapi/meta                     |     0.0%
- github.com/kommodity-io/kommodity/pkg/openapi/rbac                     |     0.0%
- github.com/kommodity-io/kommodity/pkg/openapi/runtime                  |     0.0%
- github.com/kommodity-io/kommodity/pkg/openapi/storage                  |     0.0%
- github.com/kommodity-io/kommodity/pkg/openapi/version                  |     0.0%
- github.com/kommodity-io/kommodity/pkg/provider                         |     0.0%
+ github.com/kommodity-io/kommodity/pkg/server                           |     5.4%
- github.com/kommodity-io/kommodity/pkg/storage                          |     0.0%
- github.com/kommodity-io/kommodity/pkg/storage/configmaps               |     0.0%
- github.com/kommodity-io/kommodity/pkg/storage/endpoints                |     0.0%
- github.com/kommodity-io/kommodity/pkg/storage/events                   |     0.0%
- github.com/kommodity-io/kommodity/pkg/storage/namespaces               |     0.0%
- github.com/kommodity-io/kommodity/pkg/storage/rbac                     |     0.0%
- github.com/kommodity-io/kommodity/pkg/storage/secrets                  |     0.0%
- github.com/kommodity-io/kommodity/pkg/storage/selfsubjectaccessreviews |     0.0%
- github.com/kommodity-io/kommodity/pkg/storage/serviceaccount           |     0.0%
- github.com/kommodity-io/kommodity/pkg/storage/services                 |     0.0%
- github.com/kommodity-io/kommodity/pkg/storage/storage                  |     0.0%
- github.com/kommodity-io/kommodity/pkg/storage/webhookconfigurations    |     0.0%
+ github.com/kommodity-io/kommodity/pkg/talosproxy                       |    72.4%
- github.com/kommodity-io/kommodity/pkg/ui                               |     0.0%
- github.com/kommodity-io/kommodity/pkg/ui/api                           |     0.0%

@pthuriot-corti
Paul Thuriot (pthuriot-corti) force-pushed the test/byot-talos-upgrade-flow branch 2 times, most recently from ba1f31b to 949ad17 Compare September 11, 2026 14:28
@pthuriot-corti Paul Thuriot (pthuriot-corti) changed the title test(byot): assert post-adoption talos upgrade flow in integration tests feat(byot): assert post-adoption talos upgrade flow in integration tests Sep 11, 2026
Add upgrade-status helpers (GetByotMachineUpgradeStatus, WaitForByotMachineUpgradeSettled, InstallerTagFromRef, GetByotTalosImageName) and parameterize startByotHosts with the boot Talos version.

TestByotClusterFreshAdopt now asserts every ByotMachine has desiredTalosVersion stamped from talos.imageName and the post-adoption upgrade state machine reached a terminal state (Upgraded on real hardware; Failed in Talos-in-Docker, where the LifecycleClient.Upgrade RPC is unsupported with "method is not supported in container mode").

New TestByotClusterTalosUpgrade boots maintenance containers at v1.13.0 (older than the chart target v1.13.8) and asserts the same settle; on real hardware it additionally verifies status.currentTalosVersion moved to the target tag, while in container mode that version-change check is skipped (UpgradeAppliedImageRef empty) since the upgrade cannot complete.

Signed-off-by: Paul Thuriot <pth@corti.ai>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants