kubeconfig: add explicit path, if specified to loading precedence

Kubernetes-commit: 7c8e4c83fbe66548aeb446562c29c42efe1d4386
This commit is contained in:
Maciej Szulik
2020-07-21 15:45:36 +02:00
committed by Kubernetes Publisher
parent 68bb4a9525
commit 87661a7415
4 changed files with 52 additions and 2 deletions

View File

@@ -83,10 +83,13 @@ func (o *PathOptions) GetEnvVarFiles() []string {
}
func (o *PathOptions) GetLoadingPrecedence() []string {
if o.IsExplicitFile() {
return []string{o.GetExplicitFile()}
}
if envVarFiles := o.GetEnvVarFiles(); len(envVarFiles) > 0 {
return envVarFiles
}
return []string{o.GlobalFile}
}