From 88e11d9f6d1769bd56ac56c9bf9da3bd580b9a32 Mon Sep 17 00:00:00 2001 From: Rick <1450685+LinuxSuRen@users.noreply.github.com> Date: Thu, 21 Oct 2021 16:17:40 +0800 Subject: [PATCH] Fix the version check when install ks with kubekey (#232) --- go.mod | 2 +- kubectl-plugin/common/exec.go | 2 +- kubectl-plugin/install/kk.go | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/go.mod b/go.mod index caf1a89..31b12b7 100644 --- a/go.mod +++ b/go.mod @@ -5,7 +5,7 @@ go 1.16 require ( github.com/AlecAivazis/survey/v2 v2.3.1 github.com/Masterminds/goutils v1.1.1 // indirect - github.com/Masterminds/semver v1.5.0 // indirect + github.com/Masterminds/semver v1.5.0 github.com/Masterminds/sprig v2.22.0+incompatible github.com/Pallinder/go-randomdata v1.2.0 github.com/gdamore/tcell/v2 v2.4.1-0.20210905002822-f057f0a857a1 diff --git a/kubectl-plugin/common/exec.go b/kubectl-plugin/common/exec.go index 944197c..ab2b442 100644 --- a/kubectl-plugin/common/exec.go +++ b/kubectl-plugin/common/exec.go @@ -41,7 +41,7 @@ func ExecCommand(name string, arg ...string) (err error) { //ExecCommandGetOutput run command and get output func ExecCommandGetOutput(name string, arg ...string) (string, error) { command := exec.Command(name, arg...) - output, err :=command.CombinedOutput() + output, err := command.CombinedOutput() if err != nil { return "", err } diff --git a/kubectl-plugin/install/kk.go b/kubectl-plugin/install/kk.go index bea8d49..073e36f 100644 --- a/kubectl-plugin/install/kk.go +++ b/kubectl-plugin/install/kk.go @@ -72,7 +72,7 @@ func (o *kkOption) versionCheck() (err error) { } else { o.version = ver } - } else if o.version != types.KsVersion { + } else if !isNotReleaseVersion(o.version) && o.version != types.KsVersion { switch o.version { case types.KsVersion, "v3.0.0": default: