From f14cbc3a06932eab5fa0935c53f640f9767b230a Mon Sep 17 00:00:00 2001 From: Riadh Meghenem Date: Tue, 3 Sep 2024 09:53:39 +0200 Subject: [PATCH] fix(issuer): fix annotations on ingress and certificates (#17) --- internal/controllers/certificaterequest_controller.go | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/internal/controllers/certificaterequest_controller.go b/internal/controllers/certificaterequest_controller.go index ee601d9..98bc0cf 100644 --- a/internal/controllers/certificaterequest_controller.go +++ b/internal/controllers/certificaterequest_controller.go @@ -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 { @@ -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) {