1
0
mirror of https://github.com/rancher/rke.git synced 2025-08-31 14:36:32 +00:00

Merge pull request #126 from galal-hussein/warning_on_remove

Add replace fatal with warning when can't remove local kubeconfig
This commit is contained in:
Alena Prokharchyk
2017-12-08 23:48:15 -06:00
committed by GitHub
2 changed files with 5 additions and 4 deletions

View File

@@ -111,11 +111,11 @@ func DeployAdminConfig(kubeConfig, localConfigPath string) error {
return nil
}
func RemoveAdminConfig(localConfigPath string) error {
func RemoveAdminConfig(localConfigPath string) {
logrus.Infof("Removing local admin Kubeconfig: %s", localConfigPath)
if err := os.Remove(localConfigPath); err != nil {
return fmt.Errorf("Failed to remove local admin Kubeconfig file: %v", err)
logrus.Warningf("Failed to remove local admin Kubeconfig file: %v", err)
return
}
logrus.Infof("Local admin Kubeconfig removed successfully")
return nil
}