From 0fed7c51d271fa56ae58b02b0e13c5d72a51ac52 Mon Sep 17 00:00:00 2001 From: Myasnikov Daniil Date: Fri, 13 Nov 2026 15:22:34 +0500 Subject: [PATCH] fix(api): warn when a Kubernetes spec still carries talos The Kubernetes chart no longer reads talos, but a stored or hand-edited spec that keeps the block is accepted without a word. List it with the other keys the worker pool split made inert, so the API answers with the same warning it gives for nodeGroups. Assisted-by: LLM Signed-off-by: Myasnikov Daniil --- pkg/registry/apps/application/rest.go | 2 +- pkg/registry/apps/application/rest_validation_test.go | 6 ++++++ 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/pkg/registry/apps/application/rest.go b/pkg/registry/apps/application/rest.go index aa0e24a62..6cd544994 100644 --- a/pkg/registry/apps/application/rest.go +++ b/pkg/registry/apps/application/rest.go @@ -2155,7 +2155,7 @@ const kubernetesKind = "Kubernetes" // upgraded cluster keeps them in its values until re-edited, and the adoption // migration deliberately leaves them in place rather than rewriting parent // values mid-upgrade -- but they no longer render anything on the Kubernetes CR. -var removedKubernetesFields = []string{"nodeGroups", "nodeHealthCheck", "maxNodeProvisionTime"} +var removedKubernetesFields = []string{"nodeGroups", "nodeHealthCheck", "maxNodeProvisionTime", "talos"} // warnRemovedKubernetesFields emits a client-facing admission warning for each // Phase 2-removed field still present in a Kubernetes CR's values, so an diff --git a/pkg/registry/apps/application/rest_validation_test.go b/pkg/registry/apps/application/rest_validation_test.go index f48f40d26..51a9f48ce 100644 --- a/pkg/registry/apps/application/rest_validation_test.go +++ b/pkg/registry/apps/application/rest_validation_test.go @@ -466,6 +466,12 @@ func TestWarnRemovedKubernetesFields(t *testing.T) { specJSON: `{"nodeGroups":{},"nodeHealthCheck":{"maxUnhealthy":"50%"},"maxNodeProvisionTime":"10m"}`, wantKeys: []string{"nodeGroups", "nodeHealthCheck", "maxNodeProvisionTime"}, }, + { + name: "kubernetes with a stored talos block warns", + kindName: "Kubernetes", + specJSON: `{"version":"v1.35","talos":{"version":"v1.13.6"}}`, + wantKeys: []string{"talos"}, + }, { name: "kubernetes without removed fields does not warn", kindName: "Kubernetes",