Skip to content

Commit

Permalink
Merge pull request #1677 from zchee/use-filepath-join
Browse files Browse the repository at this point in the history
馃悰  client/config: use filepath.Join for loadingRules.Precedence
  • Loading branch information
k8s-ci-robot committed Sep 28, 2021
2 parents 76b74e8 + f5a07d8 commit 13f1400
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions pkg/client/config/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ import (
"fmt"
"os"
"os/user"
"path"
"path/filepath"

"k8s.io/client-go/rest"
"k8s.io/client-go/tools/clientcmd"
Expand Down Expand Up @@ -125,7 +125,7 @@ func loadConfig(context string) (*rest.Config, error) {
if err != nil {
return nil, fmt.Errorf("could not get current user: %v", err)
}
loadingRules.Precedence = append(loadingRules.Precedence, path.Join(u.HomeDir, clientcmd.RecommendedHomeDir, clientcmd.RecommendedFileName))
loadingRules.Precedence = append(loadingRules.Precedence, filepath.Join(u.HomeDir, clientcmd.RecommendedHomeDir, clientcmd.RecommendedFileName))
}

return loadConfigWithContext("", loadingRules, context)
Expand Down

0 comments on commit 13f1400

Please sign in to comment.