Skip to content

Commit

Permalink
fix(issuer): fix annotations on ingress and certificates (#17)
Browse files Browse the repository at this point in the history
  • Loading branch information
ArcRiiad authored Sep 3, 2024
1 parent 4f388b0 commit f14cbc3
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions internal/controllers/certificaterequest_controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -378,15 +378,19 @@ func (r *CertificateRequestReconciler) certificateMetadata(ctx context.Context,
}
}

var annotations map[string]string
annotations := make(map[string]string)

// Get the annotations from the Ingress first
if ingress != nil {
annotations = ingress.GetObjectMeta().GetAnnotations()
for k, v := range ingress.GetObjectMeta().GetAnnotations() {
annotations[k] = v
}
}

if certificate != nil {
annotations = certificate.GetObjectMeta().GetAnnotations()
for k, v := range certificate.GetObjectMeta().GetAnnotations() {
annotations[k] = v
}
}

for k, v := range annotations {
Expand Down Expand Up @@ -473,7 +477,6 @@ func (r *CertificateRequestReconciler) issuerFromRequest(ctx context.Context, ce
}

return issuer, nil

}

func (r *CertificateRequestReconciler) ingressFromCertificate(ctx context.Context, certificate *cmapi.Certificate) (*v1.Ingress, error) {
Expand Down

0 comments on commit f14cbc3

Please sign in to comment.