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:
@@ -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, "")
|
||||
}
|
||||
|
Reference in New Issue
Block a user