Merge pull request #110863 from claudiubelu/path-filepath-update-2

Replaces path.Operation with filepath.Operation (part 2)
This commit is contained in:
Kubernetes Prow Robot
2023-07-13 09:56:37 -07:00
committed by GitHub
9 changed files with 32 additions and 36 deletions

View File

@@ -27,7 +27,6 @@ import (
"net"
"net/http"
"os"
"path"
"path/filepath"
"strconv"
"strings"
@@ -1011,8 +1010,8 @@ func getNodeName(cloud cloudprovider.Interface, hostname string) (types.NodeName
// certificate and key file are generated. Returns a configured server.TLSOptions object.
func InitializeTLS(kf *options.KubeletFlags, kc *kubeletconfiginternal.KubeletConfiguration) (*server.TLSOptions, error) {
if !kc.ServerTLSBootstrap && kc.TLSCertFile == "" && kc.TLSPrivateKeyFile == "" {
kc.TLSCertFile = path.Join(kf.CertDirectory, "kubelet.crt")
kc.TLSPrivateKeyFile = path.Join(kf.CertDirectory, "kubelet.key")
kc.TLSCertFile = filepath.Join(kf.CertDirectory, "kubelet.crt")
kc.TLSPrivateKeyFile = filepath.Join(kf.CertDirectory, "kubelet.key")
canReadCertAndKey, err := certutil.CanReadCertAndKey(kc.TLSCertFile, kc.TLSPrivateKeyFile)
if err != nil {