Skip to content

Commit

Permalink
fix: generating TLS certificate matching the deployed Namespace
Browse files Browse the repository at this point in the history
  • Loading branch information
prometherion committed May 23, 2021
1 parent e6da507 commit 6dc83b1
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion controllers/secret/tls.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ import (
"context"
"crypto/x509"
"encoding/pem"
"fmt"
"syscall"
"time"

Expand Down Expand Up @@ -82,7 +83,7 @@ func (r TLSReconciler) Reconcile(ctx context.Context, request ctrl.Request) (ctr
r.Log.Info("Missing Capsule TLS certificate")
rq = 6 * 30 * 24 * time.Hour

opts := cert.NewCertOpts(time.Now().Add(rq), "capsule-webhook-service.capsule-system.svc")
opts := cert.NewCertOpts(time.Now().Add(rq), fmt.Sprintf("capsule-webhook-service.%s.svc", r.Namespace))
var crt, key *bytes.Buffer
crt, key, err = ca.GenerateCertificate(opts)
if err != nil {
Expand Down

0 comments on commit 6dc83b1

Please sign in to comment.