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:
committed by
Alena Prokharchyk
parent
9679aca20c
commit
7a0406c44f
10
util/util.go
10
util/util.go
@@ -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
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user