From 59541ea438b4531ca50f9e25f110989713b987d2 Mon Sep 17 00:00:00 2001 From: elonfliter Date: Mon, 31 Aug 2026 09:04:15 +0800 Subject: [PATCH] refactor(webhook): iterate hostname labels with SplitSeq (#6251) --- internal/webhook/validate.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/internal/webhook/validate.go b/internal/webhook/validate.go index f0bace53..f4d47c87 100644 --- a/internal/webhook/validate.go +++ b/internal/webhook/validate.go @@ -127,7 +127,7 @@ func normalizeHostname(hostname string) (string, error) { return "", errors.Errorf("hostname must contain between 1 and 253 characters") } - for _, label := range strings.Split(hostname, ".") { + for label := range strings.SplitSeq(hostname, ".") { if label == "" || len(label) > 63 { return "", errors.Errorf("hostname labels must contain between 1 and 63 characters") }