Use concurrent informer for iam-folder-reconciler (#110987)

This commit is contained in:
Mihai Turdean
2025-09-11 15:57:07 -05:00
committed by GitHub
parent 310893292f
commit ac13da2d1d
4 changed files with 54 additions and 2 deletions
+12 -1
View File
@@ -31,7 +31,8 @@ type WebhookServerConfig struct {
}
type FolderReconcilerConfig struct {
Namespace string
Namespace string
MaxConcurrentWorkers uint64
}
func LoadConfigFromEnv() (*Config, error) {
@@ -115,6 +116,16 @@ func LoadConfigFromEnv() (*Config, error) {
cfg.ZanzanaClient.ServerCertFile = os.Getenv("ZANZANA_SERVER_CERT_FILE")
cfg.FolderReconciler.Namespace = os.Getenv("FOLDER_RECONCILER_NAMESPACE")
maxConcurrentWorkersStr := os.Getenv("FOLDER_RECONCILER_MAX_CONCURRENT_WORKERS")
if maxConcurrentWorkersStr == "" {
cfg.FolderReconciler.MaxConcurrentWorkers = 20
} else {
maxConcurrentWorkers, err := strconv.ParseUint(maxConcurrentWorkersStr, 10, 64)
if err != nil {
return nil, fmt.Errorf("invalid FOLDER_RECONCILER_MAX_CONCURRENT_WORKERS '%s': %w", maxConcurrentWorkersStr, err)
}
cfg.FolderReconciler.MaxConcurrentWorkers = maxConcurrentWorkers
}
return &cfg, nil
}
+3
View File
@@ -69,6 +69,9 @@ func main() {
appCfg := app.AppConfig{
ZanzanaClientCfg: cfg.ZanzanaClient,
FolderReconcilerNamespace: cfg.FolderReconciler.Namespace,
InformerConfig: app.InformerConfig{
MaxConcurrentWorkers: cfg.FolderReconciler.MaxConcurrentWorkers,
},
}
// Run