diff --git a/modules/certmanager/issuer.go b/modules/certmanager/issuer.go index 181c4b87..0bfb907f 100644 --- a/modules/certmanager/issuer.go +++ b/modules/certmanager/issuer.go @@ -42,6 +42,10 @@ const ( RootCAIssuerOvnDBLabel = "osp-rootca-issuer-ovn" // RootCAIssuerLibvirtLabel for internal RootCA to issue libvirt TLS Certs RootCAIssuerLibvirtLabel = "osp-rootca-issuer-libvirt" + // CertDurationAnnotation on an issuer reflects the duration to be used for certs being issued + CertDurationAnnotation = "cert-duration" + // CertRenewBeforeAnnotation on an issuer reflects the renewBefore to be used for certs being issued + CertRenewBeforeAnnotation = "cert-renewbefore" ) // Issuer - @@ -86,13 +90,15 @@ func CAIssuer( name string, namespace string, labels map[string]string, + annotations map[string]string, secretName string, ) *certmgrv1.Issuer { return &certmgrv1.Issuer{ ObjectMeta: metav1.ObjectMeta{ - Name: name, - Namespace: namespace, - Labels: labels, + Name: name, + Namespace: namespace, + Labels: labels, + Annotations: annotations, }, Spec: certmgrv1.IssuerSpec{ IssuerConfig: certmgrv1.IssuerConfig{ diff --git a/modules/certmanager/test/functional/certmanager_test.go b/modules/certmanager/test/functional/certmanager_test.go index ccded5f0..21bfca1d 100644 --- a/modules/certmanager/test/functional/certmanager_test.go +++ b/modules/certmanager/test/functional/certmanager_test.go @@ -100,6 +100,7 @@ var _ = Describe("certmanager module", func() { "ca", namespace, map[string]string{"f": "l"}, + map[string]string{"a": "l"}, "secret", ), timeout, @@ -111,6 +112,7 @@ var _ = Describe("certmanager module", func() { Expect(issuer.Spec.CA).NotTo(BeNil()) Expect(issuer.Spec.CA.SecretName).To(Equal("secret")) Expect(issuer.Labels["f"]).To(Equal("l")) + Expect(issuer.Annotations["a"]).To(Equal("l")) }) It("deletes issuer", func() { @@ -119,6 +121,7 @@ var _ = Describe("certmanager module", func() { names.IssuerName.Name, names.IssuerName.Namespace, map[string]string{"f": "l"}, + map[string]string{}, "secret", ), timeout, @@ -200,6 +203,7 @@ var _ = Describe("certmanager module", func() { "ca", names.Namespace, map[string]string{"f": "l"}, + map[string]string{}, "secret", ), timeout, @@ -258,6 +262,7 @@ var _ = Describe("certmanager module", func() { "ca", names.Namespace, map[string]string{"f": "l"}, + map[string]string{}, "secret", ), timeout, @@ -314,6 +319,7 @@ var _ = Describe("certmanager module", func() { "ca", names.Namespace, map[string]string{"f": "l"}, + map[string]string{}, "secret", ), timeout,