fix: check cert names and ips including tcp address (#758)

Signed-off-by: Dario Tranchitella <dario@tranchitella.eu>
This commit is contained in:
Dario Tranchitella
2025-03-27 18:34:57 +01:00
committed by GitHub
parent 05aad8ce56
commit 8b22f22bd3

View File

@@ -136,9 +136,9 @@ func (r *APIServerCertificate) mutate(ctx context.Context, tenantControlPlane *k
commonNames := config.InitConfiguration.APIServer.CertSANs
if tenantControlPlane.Spec.ControlPlane.Ingress != nil {
address, _ := utilities.GetControlPlaneAddressAndPortFromHostname(tenantControlPlane.Spec.ControlPlane.Ingress.Hostname, 6443)
commonNames = append(commonNames, address)
addr, _, aErr := tenantControlPlane.AssignedControlPlaneAddress()
if aErr == nil {
commonNames = append(commonNames, addr)
}
dnsNamesMatches, dnsErr := crypto.CheckCertificateNamesAndIPs(r.resource.Data[kubeadmconstants.APIServerCertName], commonNames)