Skip to content

Commit cf52a50

Browse files
author
Per Goncalves da Silva
committed
Fix webhook service rotation to renew within 24h of expiry
Signed-off-by: Per Goncalves da Silva <pegoncal@redhat.com>
1 parent 71108b2 commit cf52a50

File tree

2 files changed

+8
-0
lines changed

2 files changed

+8
-0
lines changed

internal/operator-controller/rukpak/render/certproviders/certmanager.go

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,7 @@ func (p CertManagerCertificateProvider) AdditionalObjects(cfg render.Certificate
5555
// OLMv0 parity:
5656
// - self-signed issuer
5757
// - 2 year rotation period
58+
// - renew 24h before expiry
5859
// - CN: argocd-operator-controller-manager-service.argocd (<deploymentName>-service.<namespace>)
5960
// - CA: false
6061
// - DNS:argocd-operator-controller-manager-service.argocd, DNS:argocd-operator-controller-manager-service.argocd.svc, DNS:argocd-operator-controller-manager-service.argocd.svc.cluster.local
@@ -165,6 +166,9 @@ func (p CertManagerCertificateProvider) AdditionalObjects(cfg render.Certificate
165166
Duration: &metav1.Duration{
166167
Duration: olmv0RotationPeriod,
167168
},
169+
RenewBefore: &metav1.Duration{
170+
Duration: 24 * time.Hour,
171+
},
168172
},
169173
}
170174
certObj, err := util.ToUnstructured(certificate)

internal/operator-controller/rukpak/render/certproviders/certmanager_test.go

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -143,6 +143,10 @@ func Test_CertManagerProvider_AdditionalObjects(t *testing.T) {
143143
// OLMv0 has a 2 year certificate rotation period
144144
Duration: 730 * 24 * time.Hour,
145145
},
146+
RenewBefore: &metav1.Duration{
147+
// OLMv0 reviews 24h before expiry
148+
Duration: 24 * time.Hour,
149+
},
146150
},
147151
}),
148152
}, objs)

0 commit comments

Comments
 (0)