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

fix rke cluster delete from cli

This commit is contained in:
kinarashah 2019-07-03 12:26:06 -07:00 committed by Alena Prokharchyk
parent 116b47b025
commit dc6f397f78
3 changed files with 5 additions and 4 deletions

View File

@ -4,6 +4,7 @@ import (
"bufio" "bufio"
"context" "context"
"fmt" "fmt"
"github.com/rancher/rke/metadata"
"os" "os"
"strings" "strings"
@ -56,6 +57,10 @@ func ClusterRemove(
flags cluster.ExternalFlags) error { flags cluster.ExternalFlags) error {
log.Infof(ctx, "Tearing down Kubernetes cluster") log.Infof(ctx, "Tearing down Kubernetes cluster")
if metadata.K8sVersionToRKESystemImages == nil {
metadata.InitMetadata(ctx)
}
kubeCluster, err := cluster.InitClusterObject(ctx, rkeConfig, flags) kubeCluster, err := cluster.InitClusterObject(ctx, rkeConfig, flags)
if err != nil { if err != nil {
return err return err

View File

@ -2,7 +2,6 @@ package metadata
import ( import (
"context" "context"
"github.com/sirupsen/logrus"
"strings" "strings"
mVersion "github.com/mcuadros/go-version" mVersion "github.com/mcuadros/go-version"
@ -21,7 +20,6 @@ var (
) )
func InitMetadata(ctx context.Context) error { func InitMetadata(ctx context.Context) error {
logrus.Infof("calling init")
initK8sRKESystemImages() initK8sRKESystemImages()
initAddonTemplates() initAddonTemplates()
initServiceOptions() initServiceOptions()

View File

@ -19,7 +19,6 @@ import (
"bytes" "bytes"
"errors" "errors"
"fmt" "fmt"
"github.com/sirupsen/logrus"
"regexp" "regexp"
"strconv" "strconv"
"strings" "strings"
@ -75,7 +74,6 @@ func (v *Version) Set(version string) error {
dotParts := strings.SplitN(version, ".", 3) dotParts := strings.SplitN(version, ".", 3)
if len(dotParts) != 3 { if len(dotParts) != 3 {
logrus.Infof("version version version %s", version)
return fmt.Errorf("%s is not in dotted-tri format", version) return fmt.Errorf("%s is not in dotted-tri format", version)
} }