mirror of
https://github.com/rancher/rke.git
synced 2025-05-13 02:46:14 +00:00
Add replace fatal with warning when can't remove local kubeconfig
This commit is contained in:
parent
3d8982af98
commit
0bd70fcdeb
@ -27,7 +27,8 @@ func (c *Cluster) ClusterRemove() error {
|
||||
return err
|
||||
}
|
||||
|
||||
return pki.RemoveAdminConfig(c.LocalKubeConfigPath)
|
||||
pki.RemoveAdminConfig(c.LocalKubeConfigPath)
|
||||
return nil
|
||||
}
|
||||
|
||||
func cleanUpHosts(cpHosts, workerHosts, etcdHosts []*hosts.Host, cleanerImage string) error {
|
||||
|
@ -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
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user