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:
Yifan Gu
2016-08-19 13:50:07 -07:00
parent 26babd4eba
commit 2e631d811c
3 changed files with 7 additions and 7 deletions

View File

@@ -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)
}