Skip to content

Commit

Permalink
feat: Restrict to namespace from the controller level
Browse files Browse the repository at this point in the history
Signed-off-by: Lukas Wöhrl <[email protected]>
  • Loading branch information
woehrl01 committed Feb 16, 2023
1 parent b282951 commit 842a3ab
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
1 change: 0 additions & 1 deletion charts/aws-pca-issuer/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,6 @@ service:
type: ClusterIP
port: 8080


# Options for configuring a target ServiceAccount with the role to approve
# all awspca.cert-manager.io requests.
approverRole:
Expand Down
4 changes: 4 additions & 0 deletions main.go
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@ func init() {

func main() {
var metricsAddr string
var restrictToNamespace string
var enableLeaderElection bool
var probeAddr string
var disableApprovedCheck bool
Expand All @@ -64,6 +65,8 @@ func main() {
"Enabling this will ensure there is only one active controller manager.")
flag.BoolVar(&disableApprovedCheck, "disable-approved-check", false,
"Disables waiting for CertificateRequests to have an approved condition before signing.")
flag.StringVar(&restrictToNamespace, "restrict-to-namespace", os.Getenv("RESTRICT_TO_NAMESPACE"),
"Restrict the controller to only process CertificateRequests in a specific namespace.")

opts := zap.Options{
Development: false,
Expand All @@ -80,6 +83,7 @@ func main() {
HealthProbeBindAddress: probeAddr,
LeaderElection: enableLeaderElection,
LeaderElectionID: "b858308c.awspca.cert-manager.io",
Namespace: restrictToNamespace,
})
if err != nil {
setupLog.Error(err, "unable to start manager")
Expand Down

0 comments on commit 842a3ab

Please sign in to comment.