Skip to content

Commit

Permalink
Merge pull request #2987 from vara2504/feature_tenantcontroller_watch
Browse files Browse the repository at this point in the history
EV-4126 Add watch for tenant controller
  • Loading branch information
caseydavenport authored Nov 8, 2023
2 parents 02abf83 + 55bcd82 commit 73d9676
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion pkg/controller/secrets/tenant_controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,16 @@ func AddTenantController(mgr manager.Manager, opts options.AddOptions) error {
return fmt.Errorf("tenant-secrets-controller failed to watch Tenant resource: %w", err)
}

// TODO Watch all the secrets created by this controller so we can regenerate any that are deleted
if err = c.Watch(&source.Kind{Type: &operatorv1.Installation{}}, &handler.EnqueueRequestForObject{}); err != nil {
return fmt.Errorf("tenant-controller failed to watch Installation resource: %w", err)
}
if err = utils.AddSecretsWatch(c, certificatemanagement.CASecretName, common.OperatorNamespace()); err != nil {
return fmt.Errorf("tenant-controller failed to watch cluster scoped CA secret %s: %w", certificatemanagement.CASecretName, err)
}

if err = utils.AddSecretsWatch(c, certificatemanagement.TenantCASecretName, ""); err != nil {
return fmt.Errorf("tenant-controller failed to watch tenant CA Secret %s in all namespace: %w", certificatemanagement.TenantCASecretName, err)
}

return nil
}
Expand Down

0 comments on commit 73d9676

Please sign in to comment.