mirror of
https://github.com/edgelesssys/constellation.git
synced 2025-10-01 21:28:52 -04:00
config: fix incorrect kubernetes version validation (#1155)
Fix incorrect string comparison by replacing it with call to semver.Compare. Also add handling to check for missing v prefix.
This commit is contained in:
parent
4c5ab7c5e9
commit
fd860ddb91
3 changed files with 23 additions and 15 deletions
|
@ -16,6 +16,7 @@ import (
|
|||
"sort"
|
||||
"strings"
|
||||
|
||||
"github.com/edgelesssys/constellation/v2/internal/compatibility"
|
||||
"github.com/edgelesssys/constellation/v2/internal/constants"
|
||||
"github.com/edgelesssys/constellation/v2/internal/versions/components"
|
||||
"golang.org/x/mod/semver"
|
||||
|
@ -26,7 +27,7 @@ func SupportedK8sVersions() []string {
|
|||
validVersions := make([]string, len(VersionConfigs))
|
||||
i := 0
|
||||
for _, conf := range VersionConfigs {
|
||||
validVersions[i] = conf.ClusterVersion
|
||||
validVersions[i] = compatibility.EnsurePrefixV(conf.ClusterVersion)
|
||||
i++
|
||||
}
|
||||
validVersionsSorted := semver.ByVersion(validVersions)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue