Skip to content

Commit

Permalink
start generic informers
Browse files Browse the repository at this point in the history
  • Loading branch information
bertinatto committed Sep 26, 2024
1 parent e6034ea commit c8af0c0
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions pkg/csoclients/csoclients.go
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,9 @@ import (

type Clients struct {
// Client for CSO's CR
OperatorClient v1helpers.OperatorClientWithFinalizers
OperatorClient v1helpers.OperatorClientWithFinalizers
OperatorClientInformers dynamicinformer.DynamicSharedInformerFactory

// Kubernetes API client
KubeClient kubernetes.Interface
// Kubernetes API informers, per namespace
Expand Down Expand Up @@ -131,7 +133,7 @@ func NewClients(controllerConfig *controllercmd.ControllerContext, resync time.D
}
c.MonitoringInformer = prominformer.NewSharedInformerFactory(c.MonitoringClient, resync)

c.OperatorClient, _, err = genericoperatorclient.NewClusterScopedOperatorClient(
c.OperatorClient, c.OperatorClientInformers, err = genericoperatorclient.NewClusterScopedOperatorClient(
controllerConfig.KubeConfig,
operatorv1.GroupVersion.WithResource("storages"),
operatorv1.GroupVersion.WithKind("Storage"),
Expand Down Expand Up @@ -241,7 +243,7 @@ func NewHypershiftGuestClients(
}
c.MonitoringInformer = prominformer.NewSharedInformerFactory(c.MonitoringClient, resync)

c.OperatorClient, _, err = genericoperatorclient.NewClusterScopedOperatorClient(
c.OperatorClient, c.OperatorClientInformers, err = genericoperatorclient.NewClusterScopedOperatorClient(
controllerConfig.KubeConfig,
operatorv1.GroupVersion.WithResource("storages"),
operatorv1.GroupVersion.WithKind("Storage"),
Expand All @@ -266,6 +268,7 @@ func StartInformers(clients *Clients, stopCh <-chan struct{}) {
Start(stopCh <-chan struct{})
}{
clients.KubeInformers,
clients.OperatorClientInformers,
clients.OperatorInformers,
clients.ConfigInformers,
clients.ExtensionInformer,
Expand All @@ -281,6 +284,7 @@ func StartGuestInformers(clients *Clients, stopCh <-chan struct{}) {
Start(stopCh <-chan struct{})
}{
clients.KubeInformers,
clients.OperatorClientInformers,
clients.OperatorInformers,
clients.ConfigInformers,
clients.ExtensionInformer,
Expand All @@ -296,6 +300,7 @@ func StartMgmtInformers(clients *Clients, stopCh <-chan struct{}) {
Start(stopCh <-chan struct{})
}{
clients.KubeInformers,
clients.OperatorClientInformers,
clients.ConfigInformers,
clients.DynamicInformer,
} {
Expand Down

0 comments on commit c8af0c0

Please sign in to comment.