Skip to content

Commit c3c6cff

Browse files
authored
Merge pull request #888 from dsbrng25b/master
🐛 Return original error from GetConfig
2 parents b6092bd + 39ddbc7 commit c3c6cff

File tree

1 file changed

+1
-4
lines changed

1 file changed

+1
-4
lines changed

pkg/client/config/config.go

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -133,11 +133,8 @@ func loadConfig(context string) (*rest.Config, error) {
133133
}
134134
loadingRules.Precedence = append(loadingRules.Precedence, path.Join(u.HomeDir, clientcmd.RecommendedHomeDir, clientcmd.RecommendedFileName))
135135
}
136-
if c, err := loadConfigWithContext(apiServerURL, loadingRules, context); err == nil {
137-
return c, nil
138-
}
139136

140-
return nil, fmt.Errorf("could not locate a kubeconfig")
137+
return loadConfigWithContext(apiServerURL, loadingRules, context)
141138
}
142139

143140
func loadConfigWithContext(apiServerURL string, loader clientcmd.ClientConfigLoader, context string) (*rest.Config, error) {

0 commit comments

Comments
 (0)