1
0
mirror of https://github.com/rancher/rke.git synced 2025-08-01 07:08:38 +00:00

Move local check to top like in up

This commit is contained in:
Sebastiaan van Steenis 2018-07-11 00:35:11 +02:00 committed by Alena Prokharchyk
parent 1ff65d1fa3
commit 8231606b2a

View File

@ -79,6 +79,9 @@ func ClusterRemove(
}
func clusterRemoveFromCli(ctx *cli.Context) error {
if ctx.Bool("local") {
return clusterRemoveLocal(ctx)
}
clusterFile, filePath, err := resolveClusterFile(ctx)
if err != nil {
return fmt.Errorf("Failed to resolve cluster file: %v", err)
@ -96,9 +99,6 @@ func clusterRemoveFromCli(ctx *cli.Context) error {
return nil
}
}
if ctx.Bool("local") {
return clusterRemoveLocal(ctx)
}
if ctx.Bool("dind") {
return clusterRemoveDind(ctx)
}
@ -120,7 +120,7 @@ func clusterRemoveLocal(ctx *cli.Context) error {
var rkeConfig *v3.RancherKubernetesEngineConfig
clusterFile, filePath, err := resolveClusterFile(ctx)
if err != nil {
log.Infof(context.Background(), "Failed to resolve cluster file, using default cluster instead")
log.Warnf(context.Background(), "Failed to resolve cluster file, using default cluster instead")
rkeConfig = cluster.GetLocalRKEConfig()
} else {
clusterFilePath = filePath