mirror of
https://github.com/cozystack/cozystack.git
synced 2026-11-21 12:13:55 +09:00
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 <myasnikovdaniil2001@gmail.com>
This commit is contained in:
2 files changed
+7
-1
No files matched your search
@@ -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
|
||||
|
||||
@@ -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",
|
||||
|
||||
Reference in new issue
Block a user