@@ -101,7 +101,6 @@ func ReconcileOVNDbClusters(ctx context.Context, instance *corev1beta1.OpenStack
101101 certRequest := certmanager.CertificateRequest {
102102 IssuerName : instance .GetOvnIssuer (),
103103 CertName : fmt .Sprintf ("%s-ovndbs" , name ),
104- Duration : nil ,
105104 // Cert needs to be valid for the individual pods in the statefulset so make this a wildcard cert
106105 Hostnames : []string {
107106 fmt .Sprintf ("*.%s.svc" , instance .Namespace ),
@@ -115,6 +114,12 @@ func ReconcileOVNDbClusters(ctx context.Context, instance *corev1beta1.OpenStack
115114 certmgrv1 .UsageClientAuth ,
116115 },
117116 }
117+ if instance .Spec .TLS .PodLevel .Ovn .Cert .Duration != nil {
118+ certRequest .Duration = & instance .Spec .TLS .PodLevel .Ovn .Cert .Duration .Duration
119+ }
120+ if instance .Spec .TLS .PodLevel .Ovn .Cert .RenewBefore != nil {
121+ certRequest .RenewBefore = & instance .Spec .TLS .PodLevel .Ovn .Cert .RenewBefore .Duration
122+ }
118123 certSecret , ctrlResult , err := certmanager .EnsureCert (
119124 ctx ,
120125 helper ,
@@ -210,7 +215,6 @@ func ReconcileOVNNorthd(ctx context.Context, instance *corev1beta1.OpenStackCont
210215 certRequest := certmanager.CertificateRequest {
211216 IssuerName : instance .GetOvnIssuer (),
212217 CertName : fmt .Sprintf ("%s-ovndbs" , "ovnnorthd" ),
213- Duration : nil ,
214218 Hostnames : []string {
215219 fmt .Sprintf ("%s.%s.svc" , serviceName , instance .Namespace ),
216220 fmt .Sprintf ("%s.%s.svc.%s" , serviceName , instance .Namespace , ovnv1 .DNSSuffix ),
@@ -223,6 +227,12 @@ func ReconcileOVNNorthd(ctx context.Context, instance *corev1beta1.OpenStackCont
223227 certmgrv1 .UsageClientAuth ,
224228 },
225229 }
230+ if instance .Spec .TLS .PodLevel .Ovn .Cert .Duration != nil {
231+ certRequest .Duration = & instance .Spec .TLS .PodLevel .Ovn .Cert .Duration .Duration
232+ }
233+ if instance .Spec .TLS .PodLevel .Ovn .Cert .RenewBefore != nil {
234+ certRequest .RenewBefore = & instance .Spec .TLS .PodLevel .Ovn .Cert .RenewBefore .Duration
235+ }
226236 certSecret , ctrlResult , err := certmanager .EnsureCert (
227237 ctx ,
228238 helper ,
@@ -312,7 +322,6 @@ func ReconcileOVNController(ctx context.Context, instance *corev1beta1.OpenStack
312322 certRequest := certmanager.CertificateRequest {
313323 IssuerName : instance .GetOvnIssuer (),
314324 CertName : fmt .Sprintf ("%s-ovndbs" , "ovncontroller" ),
315- Duration : nil ,
316325 Hostnames : []string {
317326 fmt .Sprintf ("%s.%s.svc" , serviceName , instance .Namespace ),
318327 fmt .Sprintf ("%s.%s.svc.%s" , serviceName , instance .Namespace , ovnv1 .DNSSuffix ),
@@ -325,6 +334,12 @@ func ReconcileOVNController(ctx context.Context, instance *corev1beta1.OpenStack
325334 certmgrv1 .UsageClientAuth ,
326335 },
327336 }
337+ if instance .Spec .TLS .PodLevel .Ovn .Cert .Duration != nil {
338+ certRequest .Duration = & instance .Spec .TLS .PodLevel .Ovn .Cert .Duration .Duration
339+ }
340+ if instance .Spec .TLS .PodLevel .Ovn .Cert .RenewBefore != nil {
341+ certRequest .RenewBefore = & instance .Spec .TLS .PodLevel .Ovn .Cert .RenewBefore .Duration
342+ }
328343 certSecret , ctrlResult , err := certmanager .EnsureCert (
329344 ctx ,
330345 helper ,
0 commit comments