Skip to content

feat: k8s version drift corrective UpgradePolicy in DriftSignalReconciler#27

Open
ontave wants to merge 2 commits into
mainfrom
session/25c-k8s-drift-remediation
Open

feat: k8s version drift corrective UpgradePolicy in DriftSignalReconciler#27
ontave wants to merge 2 commits into
mainfrom
session/25c-k8s-drift-remediation

Conversation

@ontave
Copy link
Copy Markdown
Contributor

@ontave ontave commented May 7, 2026

Summary

  • handleKubernetesVersionDrift added to DriftSignalReconciler: when a drift-k8s-version-{cluster} DriftSignal arrives, creates a corrective UpgradePolicy (type=kubernetes, targetKubernetesVersion=spec.kubernetesVersion) in seam-tenant-{cluster}
  • ensureCorrectiveKubeUpgradePolicy mirrors the existing ensureCorrectiveUpgradePolicy pattern for Talos version drift
  • Routing in Reconcile: InfrastructureTalosCluster signals now dispatched by name prefix -- drift-k8s-version-*handleKubernetesVersionDrift, others → handleTalosVersionDrift
  • UpgradePolicyReconciler picks up the new UpgradePolicy and submits a kube-upgrade executor Job

Test plan

  • TestDriftSignalReconciler_K8sVersionDrift_CreatesUpgradePolicy: verifies UpgradePolicy (type=kubernetes, targetKubernetesVersion=1.32.2) created and DriftSignal advanced to queued
  • All 7 existing DriftSignal tests pass
  • go build ./... clean

Closes K8S-DRIFT-CONFIRM remediation gap found in session/25b.

ontave added 2 commits May 7, 2026 07:33
When a drift-k8s-version-{cluster} DriftSignal arrives (emitted by
KubernetesVersionDriftLoop on the tenant conductor), create a corrective
UpgradePolicy (type=kubernetes, targetKubernetesVersion=spec.kubernetesVersion)
in seam-tenant-{cluster}. UpgradePolicyReconciler picks it up and submits
a kube-upgrade executor Job to bring the cluster back to declared state.

Routing: InfrastructureTalosCluster signals are now distinguished by name
prefix -- drift-k8s-version-* routes to handleKubernetesVersionDrift,
all others continue to handleTalosVersionDrift.

1 unit test: TestDriftSignalReconciler_K8sVersionDrift_CreatesUpgradePolicy.
All 7 DriftSignal unit tests pass.
…paths

reconcileVersionUpgrade now derives UpgradePolicy type from which version
fields are set: talosVersion only -> UpgradeTypeTalos (existing), kubernetesVersion
only -> UpgradeTypeKubernetes, both -> UpgradeTypeStack. Two new unit tests:
TestTalosCluster_VersionUpgrade_KubernetesOnly_CreatesKubePolicy and
TestTalosCluster_VersionUpgrade_Stack_CreatesBothVersions. All 8 version
upgrade tests pass.
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.

1 participant