Skip to content

Commit 4a5c760

Browse files
Kamil PrzybylKamil Przybyl
authored andcommitted
chore: clarify isCertValid
1 parent 4a8352c commit 4a5c760

1 file changed

Lines changed: 5 additions & 3 deletions

File tree

pkg/alb/ingress/alb_spec.go

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -351,8 +351,10 @@ func (r *IngressClassReconciler) cleanupCerts(ctx context.Context, ingressClass
351351
return nil
352352
}
353353

354-
// isCertValid checks if the certificate chain is complete. It is used for checking if
355-
// the cert-manager's ACME challenge is completed, or if it's sill ongoing.
354+
// isCertValid returns true only if the certificate chain is complete (leaf + intermediates).
355+
// This is critical because the Certificates API lacks an update method; once a certificate
356+
// is created, it is immutable. We must wait for the full chain to avoid being stuck with
357+
// a temporary placeholder or an incomplete ACME response that cannot be corrected.
356358
func isCertValid(secret *corev1.Secret) (bool, error) {
357359
tlsCert := secret.Data["tls.crt"]
358360
if tlsCert == nil {
@@ -380,7 +382,7 @@ func isCertValid(secret *corev1.Secret) (bool, error) {
380382
certs = append(certs, cert)
381383
}
382384

383-
// If there are multiple certificates, it means the chain is likely complete
385+
// A single block is often an incomplete ACME response.
384386
return len(certs) > 1, nil
385387
}
386388

0 commit comments

Comments
 (0)