resolved comments

This commit is contained in:
Safwan
2026-07-17 12:03:38 +05:00
parent 6195dd91e1
commit 80032eb380
10 changed files with 561 additions and 28 deletions
+14
View File
@@ -5,6 +5,7 @@ import (
"strings"
"k8s.io/apimachinery/pkg/labels"
apivalidation "k8s.io/apimachinery/pkg/util/validation"
"github.com/stakater/Reloader/internal/pkg/workload"
)
@@ -97,6 +98,19 @@ func (c *Config) Validate() error {
)
}
// Watched namespaces must be valid DNS-1123 labels; an invalid entry would
// otherwise fail deep inside the controller-runtime cache with an opaque error.
for _, ns := range c.WatchedNamespaces {
if msgs := apivalidation.IsDNS1123Label(ns); len(msgs) > 0 {
errs = append(
errs, ValidationError{
Field: "WatchedNamespaces",
Message: fmt.Sprintf("invalid namespace %q: %s", ns, strings.Join(msgs, "; ")),
},
)
}
}
c.IgnoredResources = normalizeToLower(c.IgnoredResources)
// Normalize ignored workloads to canonical Kind values (e.g., "cronjobs" -> "CronJob")