1
0
mirror of https://github.com/kubernetes-sigs/descheduler.git synced 2026-01-26 05:14:13 +01:00

Merge pull request #1457 from googs1025/refactor_method

fix: add info for error return
This commit is contained in:
Kubernetes Prow Robot
2024-07-07 11:10:32 -07:00
committed by GitHub

View File

@@ -67,11 +67,11 @@ func GetMasterFromKubeconfig(filename string) (string, error) {
context, ok := config.Contexts[config.CurrentContext]
if !ok {
return "", fmt.Errorf("failed to get master address from kubeconfig")
return "", fmt.Errorf("failed to get master address from kubeconfig: current context not found")
}
if val, ok := config.Clusters[context.Cluster]; ok {
return val.Server, nil
}
return "", fmt.Errorf("failed to get master address from kubeconfig")
return "", fmt.Errorf("failed to get master address from kubeconfig: cluster information not found")
}