diff --git a/test/framework/versions/versions.go b/test/framework/versions/versions.go index aa9640e2b734..ca453dd6b335 100644 --- a/test/framework/versions/versions.go +++ b/test/framework/versions/versions.go @@ -17,6 +17,7 @@ type Version struct { Version string `json:"version"` Lts bool `json:"lts,omitempty"` EndOfLifeDate string `json:"endOfLifeDate"` + ReleaseDate string `json:"releaseDate"` SemVer *semver.Version } @@ -55,6 +56,9 @@ func UpgradableVersions(versions []Version, currentVersion semver.Version) []str } var res []string for _, version := range versions { + if version.ReleaseDate == "" { + continue + } if version.EndOfLifeDate != "" { eol, err := time.Parse(time.DateOnly, version.EndOfLifeDate) if err != nil { diff --git a/test/framework/versions/versions_test.go b/test/framework/versions/versions_test.go index 74eb07bb26ad..2a9309607dc1 100644 --- a/test/framework/versions/versions_test.go +++ b/test/framework/versions/versions_test.go @@ -12,11 +12,12 @@ var _ = Describe("versions", func() { DescribeTable("should return the list of versions that can be upgraded to the latest", func(currentStr string, expectedVersions []string) { // given vers := []versions.Version{ - {SemVer: semver.MustParse("1.1.1")}, - {SemVer: semver.MustParse("1.2.3"), Lts: true, EndOfLifeDate: "2100-01-01"}, - {SemVer: semver.MustParse("1.3.1")}, - {SemVer: semver.MustParse("1.4.2")}, - {SemVer: semver.MustParse("1.5.8")}, + {SemVer: semver.MustParse("1.1.1"), ReleaseDate: "2024-02-01"}, + {SemVer: semver.MustParse("1.2.3"), Lts: true, EndOfLifeDate: "2100-01-01", ReleaseDate: "2024-03-01"}, + {SemVer: semver.MustParse("1.3.1"), ReleaseDate: "2024-04-01"}, + {SemVer: semver.MustParse("1.4.2"), ReleaseDate: "2024-05-01"}, + {SemVer: semver.MustParse("1.5.8"), ReleaseDate: "2024-06-01"}, + {SemVer: semver.MustParse("1.5.9")}, } // when current := semver.MustParse(currentStr)