mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-07-27 05:27:21 +00:00
When using the bootstrap cert, update the store
Otherwise, the certificate store will return nil the first time a store cert is accessed. When background rotation is being used, prevents the client from being nil.
This commit is contained in:
parent
0346145615
commit
b81f474554
@ -268,6 +268,13 @@ func getCurrentCertificateOrBootstrap(
|
|||||||
return nil, false, fmt.Errorf("unable to parse certificate data: %v", err)
|
return nil, false, fmt.Errorf("unable to parse certificate data: %v", err)
|
||||||
}
|
}
|
||||||
bootstrapCert.Leaf = certs[0]
|
bootstrapCert.Leaf = certs[0]
|
||||||
|
|
||||||
|
if _, err := store.Update(bootstrapCertificatePEM, bootstrapKeyPEM); err != nil {
|
||||||
|
utilruntime.HandleError(fmt.Errorf("Unable to set the cert/key pair to the bootstrap certificate: %v", err))
|
||||||
|
} else {
|
||||||
|
glog.V(4).Infof("Updated the store to contain the initial bootstrap certificate")
|
||||||
|
}
|
||||||
|
|
||||||
return &bootstrapCert, true, nil
|
return &bootstrapCert, true, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user