1
0
mirror of https://github.com/rancher/rke.git synced 2025-09-01 23:16:22 +00:00

Check legacy state if kubeconfig doesnt exist

This commit is contained in:
galal-hussein
2019-04-23 21:44:42 +02:00
committed by Alena Prokharchyk
parent 9679aca20c
commit 7a0406c44f
4 changed files with 45 additions and 12 deletions

View File

@@ -103,3 +103,13 @@ func GetTagMajorVersion(tag string) string {
}
return strings.Join(splitTag[:2], ".")
}
func IsFileExists(filePath string) (bool, error) {
if _, err := os.Stat(filePath); err == nil {
return true, nil
} else if os.IsNotExist(err) {
return false, nil
} else {
return false, err
}
}