Skip to content

Commit 0fed7c5

Browse files
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 <[email protected]>
1 parent e56e66a commit 0fed7c5

2 files changed

Lines changed: 7 additions & 1 deletion

File tree

‎pkg/registry/apps/application/rest.go‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2155,7 +2155,7 @@ const kubernetesKind = "Kubernetes"
21552155
// upgraded cluster keeps them in its values until re-edited, and the adoption
21562156
// migration deliberately leaves them in place rather than rewriting parent
21572157
// values mid-upgrade -- but they no longer render anything on the Kubernetes CR.
2158-
var removedKubernetesFields = []string{"nodeGroups", "nodeHealthCheck", "maxNodeProvisionTime"}
2158+
var removedKubernetesFields = []string{"nodeGroups", "nodeHealthCheck", "maxNodeProvisionTime", "talos"}
21592159

21602160
// warnRemovedKubernetesFields emits a client-facing admission warning for each
21612161
// Phase 2-removed field still present in a Kubernetes CR's values, so an

‎pkg/registry/apps/application/rest_validation_test.go‎

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -466,6 +466,12 @@ func TestWarnRemovedKubernetesFields(t *testing.T) {
466466
specJSON: `{"nodeGroups":{},"nodeHealthCheck":{"maxUnhealthy":"50%"},"maxNodeProvisionTime":"10m"}`,
467467
wantKeys: []string{"nodeGroups", "nodeHealthCheck", "maxNodeProvisionTime"},
468468
},
469+
{
470+
name: "kubernetes with a stored talos block warns",
471+
kindName: "Kubernetes",
472+
specJSON: `{"version":"v1.35","talos":{"version":"v1.13.6"}}`,
473+
wantKeys: []string{"talos"},
474+
},
469475
{
470476
name: "kubernetes without removed fields does not warn",
471477
kindName: "Kubernetes",

0 commit comments

Comments
 (0)