mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-09-16 22:53:22 +00:00
Fixes using externally managed certs for kubeadm
Walk the certificate tree, at each step checking for a CACert. If the CACert is found, try to use it to generate certificates. Otherwise, generate a new CA cert.
This commit is contained in:
@@ -396,6 +396,11 @@ func validateSignedCert(l certKeyLocation) error {
|
||||
return fmt.Errorf("failure loading certificate authority for %s: %v", l.uxName, err)
|
||||
}
|
||||
|
||||
return validateSignedCertWithCA(l, caCert)
|
||||
}
|
||||
|
||||
// validateSignedCertWithCA tries to load a certificate and validate it with the given caCert
|
||||
func validateSignedCertWithCA(l certKeyLocation, caCert *x509.Certificate) error {
|
||||
// Try to load key and signed certificate
|
||||
signedCert, _, err := pkiutil.TryLoadCertAndKeyFromDisk(l.pkiDir, l.baseName)
|
||||
if err != nil {
|
||||
|
Reference in New Issue
Block a user