File tree Expand file tree Collapse file tree 1 file changed +9
-0
lines changed
components/node-labeler/cmd Expand file tree Collapse file tree 1 file changed +9
-0
lines changed Original file line number Diff line number Diff line change @@ -34,6 +34,7 @@ import (
3434 "sigs.k8s.io/controller-runtime/pkg/controller"
3535 "sigs.k8s.io/controller-runtime/pkg/event"
3636 "sigs.k8s.io/controller-runtime/pkg/healthz"
37+ "sigs.k8s.io/controller-runtime/pkg/manager"
3738 "sigs.k8s.io/controller-runtime/pkg/metrics"
3839 metricsserver "sigs.k8s.io/controller-runtime/pkg/metrics/server"
3940 "sigs.k8s.io/controller-runtime/pkg/predicate"
@@ -132,6 +133,14 @@ var runCmd = &cobra.Command{
132133 log .WithError (err ).Fatal ("unable to bind workspace count controller" )
133134 }
134135
136+ err = mgr .Add (manager .RunnableFunc (func (context.Context ) error {
137+ wc .Stop ()
138+ return nil
139+ }))
140+ if err != nil {
141+ log .WithError (err ).Fatal ("couldn't properly clean up WorkspaceCountController" )
142+ }
143+
135144 metrics .Registry .MustRegister (NodeLabelerCounterVec )
136145 metrics .Registry .MustRegister (NodeLabelerTimeHistVec )
137146
You can’t perform that action at this time.
0 commit comments