Skip to content

Commit

Permalink
Remove AddToScheme call in event controller New
Browse files Browse the repository at this point in the history
The global scheme is already set up by the callers and calling
AddToScheme here can cause intermittent data race failures in
unit tests.

Signed-off-by: Tom Pantelis <tompantelis@gmail.com>
  • Loading branch information
tpantelis committed Feb 6, 2025
1 parent 4e34c92 commit 50c1dab
Showing 1 changed file with 0 additions and 6 deletions.
6 changes: 0 additions & 6 deletions pkg/event/controller/controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,6 @@ import (
v1 "k8s.io/apimachinery/pkg/apis/meta/v1"
"k8s.io/apimachinery/pkg/runtime"
"k8s.io/client-go/dynamic"
"k8s.io/client-go/kubernetes/scheme"
"k8s.io/client-go/tools/cache"
logf "sigs.k8s.io/controller-runtime/pkg/log"
)
Expand Down Expand Up @@ -119,11 +118,6 @@ func New(config *Config) (*Controller, error) {
return nil, errors.Wrap(err, "error processing env vars")
}

err = subv1.AddToScheme(scheme.Scheme)
if err != nil {
return nil, errors.Wrap(err, "error adding submariner types to the scheme")
}

syncerConfig := &syncer.ResourceSyncerConfig{
SourceNamespace: env.Namespace,
SourceClient: config.Client,
Expand Down

0 comments on commit 50c1dab

Please sign in to comment.