Skip to content

Commit

Permalink
fix: KubeSphere version check error
Browse files Browse the repository at this point in the history
Signed-off-by: pixiake <guofeng@yunify.com>
  • Loading branch information
pixiake committed Jul 26, 2023
1 parent 3e84255 commit c849e91
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
4 changes: 3 additions & 1 deletion cmd/kk/pkg/bootstrap/precheck/tasks.go
Original file line number Diff line number Diff line change
Expand Up @@ -241,9 +241,11 @@ func (k *KsVersionCheck) Execute(runtime connector.Runtime) error {
ccKsVersionStr, ccErr := runtime.GetRunner().SudoCmd(
"/usr/local/bin/kubectl get ClusterConfiguration ks-installer -n kubesphere-system -o jsonpath='{.metadata.labels.version}'",
false)
if ccErr == nil && ksVersionStr == "v3.1.0" {

if ccErr == nil && versionutil.MustParseSemantic(ccKsVersionStr).AtLeast(versionutil.MustParseSemantic("v3.1.0")) {
ksVersionStr = ccKsVersionStr
}

k.PipelineCache.Set(common.KubeSphereVersion, ksVersionStr)
return nil
}
Expand Down
4 changes: 4 additions & 0 deletions cmd/kk/pkg/version/kubernetes/version_enum.go
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ const (
V123
V124
V125
V126
)

var VersionList = []Version{
Expand All @@ -45,6 +46,7 @@ var VersionList = []Version{
V123,
V124,
V125,
V126,
}

func (v Version) String() string {
Expand All @@ -63,6 +65,8 @@ func (v Version) String() string {
return "v1.24"
case V125:
return "v1.25"
case V126:
return "v1.26"
default:
return "invalid option"
}
Expand Down

0 comments on commit c849e91

Please sign in to comment.