Skip to content

Commit 3e24482

Browse files
authored
fix: create separate config client to resolve APIServer TLS update conflicts (#3753)
Problem: The olm-operator fails to receive subsequent APIServer TLS configuration updates after the initial sync. This is because two SharedInformerFactory instances were being created from the same client, causing watch conflicts: 1. APIServer TLS factory (created in SetupAPIServerTLSConfig) 2. Proxy factory (created inside the OLM operator) Both factories watch config.openshift.io resources but don't share watch state, leading to one factory not receiving all update events. Solution: Create a separate configclientset.Interface instance for the operator's proxy syncer. This ensures each SharedInformerFactory has its own client, preventing watch conflicts.
1 parent 73a2205 commit 3e24482

1 file changed

Lines changed: 8 additions & 3 deletions

File tree

cmd/olm/main.go

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -133,9 +133,14 @@ func main() {
133133
// create a config that validates we're creating objects with labels
134134
validatingConfig := validatingroundtripper.Wrap(config, mgr.GetScheme())
135135

136-
versionedConfigClient, err := configclientset.NewForConfig(config)
136+
// Create separate config client for operator's proxy syncer to avoid
137+
// SharedInformerFactory conflicts with the APIServer TLS syncer factory.
138+
// The APIServer TLS syncer (in SetupAPIServerTLSConfig) creates its own
139+
// factory, and the operator's proxy syncer creates another factory. Using
140+
// separate client instances prevents watch conflicts between the two factories.
141+
operatorConfigClient, err := configclientset.NewForConfig(config)
137142
if err != nil {
138-
logger.WithError(err).Fatal("error configuring openshift proxy client")
143+
logger.WithError(err).Fatal("error configuring openshift config client for operator")
139144
}
140145
configClient, err := configv1client.NewForConfig(config)
141146
if err != nil {
@@ -189,7 +194,7 @@ func main() {
189194
olm.WithMetadataClient(metadataClient),
190195
olm.WithOperatorClient(opClient),
191196
olm.WithRestConfig(validatingConfig),
192-
olm.WithConfigClient(versionedConfigClient),
197+
olm.WithConfigClient(operatorConfigClient),
193198
olm.WithProtectedCopiedCSVNamespaces(*protectedCopiedCSVNamespaces),
194199
olm.WithOpenshiftConfigAPIExists(openshiftConfigAPIExists),
195200
)

0 commit comments

Comments
 (0)