mirror of
https://github.com/stakater/Reloader.git
synced 2026-08-27 14:37:17 +00:00
Merge pull request #152 from liuming-dev/refactor--code-polish
Polishing code
This commit is contained in:
@@ -78,7 +78,6 @@ func GetKubernetesClient() (*kubernetes.Clientset, error) {
|
|||||||
|
|
||||||
func getConfig() (*rest.Config, error) {
|
func getConfig() (*rest.Config, error) {
|
||||||
var config *rest.Config
|
var config *rest.Config
|
||||||
var err error
|
|
||||||
kubeconfigPath := os.Getenv("KUBECONFIG")
|
kubeconfigPath := os.Getenv("KUBECONFIG")
|
||||||
if kubeconfigPath == "" {
|
if kubeconfigPath == "" {
|
||||||
kubeconfigPath = os.Getenv("HOME") + "/.kube/config"
|
kubeconfigPath = os.Getenv("HOME") + "/.kube/config"
|
||||||
@@ -95,9 +94,6 @@ func getConfig() (*rest.Config, error) {
|
|||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if err != nil {
|
|
||||||
return nil, err
|
|
||||||
}
|
|
||||||
|
|
||||||
return config, nil
|
return config, nil
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user