Files
kubesphere/pkg/utils/k8sutil/version.go
KubeSphere CI Bot d2f811b1a1 [release-4.1] fix: make the prerelease version compatible (#6301)
fix: make the prerelease version compatible

Signed-off-by: wenhaozhou <wenhaozhou@yunify.com>
Co-authored-by: wenhaozhou <wenhaozhou@yunify.com>
2024-12-03 15:39:44 +08:00

23 lines
594 B
Go

/*
* Please refer to the LICENSE file in the root directory of the project.
* https://github.com/kubesphere/kubesphere/blob/master/LICENSE
*/
package k8sutil
import (
"github.com/Masterminds/semver/v3"
)
func ServeBatchV1beta1(k8sVersion *semver.Version) bool {
// add "-0" to make the prerelease version compatible.
c, _ := semver.NewConstraint("< 1.21.0-0")
return c.Check(k8sVersion)
}
func ServeAutoscalingV2beta2(k8sVersion *semver.Version) bool {
// add "-0" to make the prerelease version compatible.
c, _ := semver.NewConstraint("< 1.23.0-0")
return c.Check(k8sVersion)
}