1
0
mirror of https://github.com/rancher/rke.git synced 2025-09-12 13:18:47 +00:00

Custom dialers and remove local fixes

This commit is contained in:
galal-hussein
2018-02-03 03:04:53 +02:00
parent 313360b11f
commit cd1e5cf610
4 changed files with 17 additions and 6 deletions

View File

@@ -98,6 +98,17 @@ func clusterRemoveFromCli(ctx *cli.Context) error {
func clusterRemoveLocal(ctx *cli.Context) error {
var rkeConfig *v3.RancherKubernetesEngineConfig
rkeConfig = cluster.GetLocalRKEConfig()
clusterFile, filePath, err := resolveClusterFile(ctx)
if err != nil {
log.Infof(context.Background(), "Failed to resolve cluster file, using default cluster instead")
rkeConfig = cluster.GetLocalRKEConfig()
} else {
clusterFilePath = filePath
rkeConfig, err = cluster.ParseConfig(clusterFile)
if err != nil {
return fmt.Errorf("Failed to parse cluster file: %v", err)
}
rkeConfig.Nodes = []v3.RKEConfigNode{*cluster.GetLocalRKENodeConfig()}
}
return ClusterRemove(context.Background(), rkeConfig, nil, true, "")
}