From 3f45ceed402140db1514c4988d387f86ce233c74 Mon Sep 17 00:00:00 2001 From: Sergey Sannikov Date: Thu, 20 Aug 2026 11:19:47 +0400 Subject: [PATCH] lint: make walkKeys switch exhaustive The yaml.Kind switch in walkKeys handled only Mapping and Sequence nodes; the exhaustive linter flags the missing Document/Scalar/Alias cases. Add a default branch (those nodes carry no mapping keys to check). Signed-off-by: Sergey Sannikov --- internal/chart/v3/lint/rules/valuekeys.go | 2 ++ pkg/chart/v2/lint/rules/valuekeys.go | 2 ++ 2 files changed, 4 insertions(+) diff --git a/internal/chart/v3/lint/rules/valuekeys.go b/internal/chart/v3/lint/rules/valuekeys.go index 04c2e2d5c..ecb70d54e 100644 --- a/internal/chart/v3/lint/rules/valuekeys.go +++ b/internal/chart/v3/lint/rules/valuekeys.go @@ -83,6 +83,8 @@ func walkKeys(n *yaml.Node, path string, found *[]booleanLikeKey) { for i, c := range n.Content { walkKeys(c, fmt.Sprintf("%s[%d]", path, i), found) } + default: + // Scalar, alias and document nodes carry no mapping keys to check. } } diff --git a/pkg/chart/v2/lint/rules/valuekeys.go b/pkg/chart/v2/lint/rules/valuekeys.go index 04c2e2d5c..ecb70d54e 100644 --- a/pkg/chart/v2/lint/rules/valuekeys.go +++ b/pkg/chart/v2/lint/rules/valuekeys.go @@ -83,6 +83,8 @@ func walkKeys(n *yaml.Node, path string, found *[]booleanLikeKey) { for i, c := range n.Content { walkKeys(c, fmt.Sprintf("%s[%d]", path, i), found) } + default: + // Scalar, alias and document nodes carry no mapping keys to check. } }