Skip to content

Commit 6d7ffd5

Browse files
authored
fix: enable controller-runtime priority queue (#1290)
1 parent 058b82e commit 6d7ffd5

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

internal/operator/operator.go

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,10 +17,12 @@ import (
1717
utilruntime "k8s.io/apimachinery/pkg/util/runtime"
1818
"k8s.io/client-go/kubernetes"
1919
clientgoscheme "k8s.io/client-go/kubernetes/scheme"
20+
"k8s.io/utils/ptr"
2021
ctrl "sigs.k8s.io/controller-runtime"
2122
"sigs.k8s.io/controller-runtime/pkg/cache"
2223
"sigs.k8s.io/controller-runtime/pkg/client"
2324
"sigs.k8s.io/controller-runtime/pkg/client/apiutil"
25+
ctrlconfig "sigs.k8s.io/controller-runtime/pkg/config"
2426
"sigs.k8s.io/controller-runtime/pkg/event"
2527
"sigs.k8s.io/controller-runtime/pkg/healthz"
2628
"sigs.k8s.io/controller-runtime/pkg/metrics/server"
@@ -127,6 +129,9 @@ func (o Operator) Start(cfg config.Config) error {
127129
Unstructured: true,
128130
DisableFor: []client.Object{&eventsv1.Event{}},
129131
}},
132+
Controller: ctrlconfig.Controller{
133+
UsePriorityQueue: ptr.To(true),
134+
},
130135
Scheme: scheme,
131136
MapperProvider: apiutil.NewDynamicRESTMapper,
132137
Metrics: metricsOpts,

0 commit comments

Comments
 (0)