Skip to content

Commit 38f9237

Browse files
committed
chore: SkipNameValidation for controllers
Signed-off-by: Hristo Hristov <[email protected]>
1 parent a673c3b commit 38f9237

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

internal/controllers/watchdog/crds_watcher.go

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ import (
1616
ctrl "sigs.k8s.io/controller-runtime"
1717
"sigs.k8s.io/controller-runtime/pkg/builder"
1818
"sigs.k8s.io/controller-runtime/pkg/client"
19+
controllerconfig "sigs.k8s.io/controller-runtime/pkg/config"
1920
"sigs.k8s.io/controller-runtime/pkg/event"
2021
"sigs.k8s.io/controller-runtime/pkg/handler"
2122
"sigs.k8s.io/controller-runtime/pkg/manager"
@@ -52,7 +53,6 @@ func (c *CRDWatcher) SetupWithManager(ctx context.Context, mgr manager.Manager)
5253

5354
for _, api := range apis {
5455
slashedName := fmt.Sprintf("%s/%s", api.Group, api.Kind)
55-
5656
if _, ok := bundleGroupAndKind[slashedName]; !ok {
5757
bundleGroupAndKind[slashedName] = sets.Set[string]{}
5858
}
@@ -140,7 +140,11 @@ func (c *CRDWatcher) keyFunction(group, kind string) string {
140140
}
141141

142142
func (c *CRDWatcher) register(ctx context.Context, group string, versions []string, kind string) error {
143+
skipControllerNameValidation := true
143144
mgr, _ := ctrl.NewManager(ctrl.GetConfigOrDie(), ctrl.Options{
145+
Controller: controllerconfig.Controller{
146+
SkipNameValidation: &skipControllerNameValidation,
147+
},
144148
Scheme: c.Client.Scheme(),
145149
Metrics: metricsserver.Options{
146150
BindAddress: "0",

0 commit comments

Comments
 (0)