mirror of
https://gitee.com/rainbond/Rainbond.git
synced 2024-12-04 04:38:04 +08:00
Merge pull request #1132 from yangkaa/550-dind
Fix Bug: panic caused by error getting cluster version
This commit is contained in:
commit
4241e40081
@ -138,7 +138,11 @@ func IsHighVersion() bool {
|
||||
|
||||
// GetKubeVersion returns the version of k8s
|
||||
func GetKubeVersion() *utilversion.Version {
|
||||
var serverVersion, _ = GetClientSet().Discovery().ServerVersion()
|
||||
var serverVersion, err = GetClientSet().Discovery().ServerVersion()
|
||||
if err != nil {
|
||||
logrus.Errorf("Get Kubernetes Version failed [%+v]", err)
|
||||
return utilversion.MustParseSemantic("v1.19.6")
|
||||
}
|
||||
return utilversion.MustParseSemantic(serverVersion.GitVersion)
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user