Skip to content

Commit

Permalink
feat(validate): properly check for supported Talos version
Browse files Browse the repository at this point in the history
This will make sure only released version will be considered a valid
Talos version
  • Loading branch information
budimanjojo committed Dec 23, 2023
1 parent 2ad1aff commit 6396cd7
Showing 1 changed file with 1 addition and 14 deletions.
15 changes: 1 addition & 14 deletions pkg/config/validator.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@ import (
"github.com/siderolabs/talos/pkg/machinery/compatibility"
"github.com/siderolabs/talos/pkg/machinery/config/types/v1alpha1"
"github.com/siderolabs/talos/pkg/machinery/labels"
"golang.org/x/mod/semver"
)

func checkRequiredCfg(c TalhelperConfig, result *Errors) *Errors {
Expand Down Expand Up @@ -54,19 +53,7 @@ func checkSupportedTalosVersion(c TalhelperConfig, result *Errors) *Errors {
if !strings.HasPrefix(c.TalosVersion, "v") {
c.TalosVersion = "v" + c.TalosVersion
}
majorMinor := semver.MajorMinor(c.TalosVersion)
switch majorMinor {
case "v1.2":
return result
case "v1.3":
return result
case "v1.4":
return result
case "v1.5":
return result
case "v1.6":
return result
default:
if !OfficialExtensions.Contains(c.TalosVersion) {
return result.Append(&Error{
Kind: "InvalidTalosVersion",
Field: getFieldYamlTag(c, "TalosVersion"),
Expand Down

0 comments on commit 6396cd7

Please sign in to comment.