Skip to content

Commit

Permalink
Fix for ClusterIssuer
Browse files Browse the repository at this point in the history
Signed-off-by: Neaj Morshad <[email protected]>
  • Loading branch information
Neaj-Morshad-101 committed Oct 24, 2024
1 parent 6e46863 commit 0a24a18
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion pkg/controllers/cacerts/caproviderclass_controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -78,11 +78,16 @@ func (r *CAProviderClassReconciler) SetupWithManager(mgr ctrl.Manager) error {
continue
}

// Determine the namespace for secrets
ns = ref.Namespace
if ns == "" {
if ref.Kind == "ClusterIssuer" {
// If the reference is to a ClusterIssuer, we want to look for the secret in the cert-manager namespace
ns = "cert-manager" // Change this to the actual namespace where cert-manager is running
} else if ns == "" {
ns = p.Namespace
}

// Only enqueue if the namespaces match
if a.GetNamespace() != "" && a.GetNamespace() != ns {
continue
}
Expand Down

0 comments on commit 0a24a18

Please sign in to comment.