Skip to content

Commit

Permalink
disable AWSPCAClusterIssuer if namespace restriction
Browse files Browse the repository at this point in the history
  • Loading branch information
woehrl01 committed Feb 17, 2023
1 parent 842a3ab commit 34b699a
Showing 1 changed file with 15 additions and 8 deletions.
23 changes: 15 additions & 8 deletions main.go
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,7 @@ func main() {
Recorder: mgr.GetEventRecorderFor("awspcaissuer-controller"),
GetCallerIdentity: true,
}

if err = (&controllers.AWSPCAIssuerReconciler{
Client: mgr.GetClient(),
Log: ctrl.Log.WithName("controllers").WithName("AWSPCAIssuer"),
Expand All @@ -106,15 +107,21 @@ func main() {
setupLog.Error(err, "unable to create controller", "controller", "AWSPCAIssuer")
os.Exit(1)
}
if err = (&controllers.AWSPCAClusterIssuerReconciler{
Client: mgr.GetClient(),
Log: ctrl.Log.WithName("controllers").WithName("AWSPCAClusterIssuer"),
Scheme: mgr.GetScheme(),
GenericController: genericIssuerController,
}).SetupWithManager(mgr); err != nil {
setupLog.Error(err, "unable to create controller", "controller", "AWSPCAClusterIssuer")
os.Exit(1)

if restrictToNamespace != "" {
setupLog.Info("restricting controller to namespace, disable AWSPCAClusterIssuer controller", "namespace", restrictToNamespace)
} else {
if err = (&controllers.AWSPCAClusterIssuerReconciler{
Client: mgr.GetClient(),
Log: ctrl.Log.WithName("controllers").WithName("AWSPCAClusterIssuer"),
Scheme: mgr.GetScheme(),
GenericController: genericIssuerController,
}).SetupWithManager(mgr); err != nil {
setupLog.Error(err, "unable to create controller", "controller", "AWSPCAClusterIssuer")
os.Exit(1)
}
}

if err = (&controllers.CertificateRequestReconciler{
Client: mgr.GetClient(),
Log: ctrl.Log.WithName("controllers").WithName("CertificateRequest"),
Expand Down

0 comments on commit 34b699a

Please sign in to comment.