mirror of
https://github.com/k3s-io/kubernetes.git
synced 2026-01-29 21:29:24 +00:00
crypto.go: Rename ShouldGenSelfSignedCerts() to FoundCertOrKey().
Since the function only tests whether the files are on the disk, the original name is a little bit misleading.
This commit is contained in:
@@ -699,7 +699,7 @@ func InitializeTLS(s *options.KubeletServer) (*server.TLSOptions, error) {
|
||||
if s.TLSCertFile == "" && s.TLSPrivateKeyFile == "" {
|
||||
s.TLSCertFile = path.Join(s.CertDirectory, "kubelet.crt")
|
||||
s.TLSPrivateKeyFile = path.Join(s.CertDirectory, "kubelet.key")
|
||||
if crypto.ShouldGenSelfSignedCerts(s.TLSCertFile, s.TLSPrivateKeyFile) {
|
||||
if !crypto.FoundCertOrKey(s.TLSCertFile, s.TLSPrivateKeyFile) {
|
||||
if err := crypto.GenerateSelfSignedCert(nodeutil.GetHostname(s.HostnameOverride), s.TLSCertFile, s.TLSPrivateKeyFile, nil, nil); err != nil {
|
||||
return nil, fmt.Errorf("unable to generate self signed cert: %v", err)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user