diff --git a/cmd/schedule-builder/cmd/markdown.go b/cmd/schedule-builder/cmd/markdown.go index 15e8e356de68..3326040c66b7 100644 --- a/cmd/schedule-builder/cmd/markdown.go +++ b/cmd/schedule-builder/cmd/markdown.go @@ -173,12 +173,17 @@ func updatePatchSchedule(refTime time.Time, schedule PatchSchedule, eolBranches removeSchedules := []int{} for i, sched := range schedule.Schedules { for { + if sched.Next == nil { + logrus.Warnf("Next release not set for %v, skipping", sched.Release) + break + } + eolDate, err := time.Parse(refDate, sched.EndOfLifeDate) if err != nil { return fmt.Errorf("parse end of life date: %w", err) } - if refTime.After(eolDate) { + if refTime.After(eolDate) || sched.Next == nil { if eolFilePath == "" { logrus.Infof("Skipping end of life release: %s", sched.Release) break diff --git a/cmd/schedule-builder/cmd/markdown_test.go b/cmd/schedule-builder/cmd/markdown_test.go index ea60d5578b6a..6c817f561832 100644 --- a/cmd/schedule-builder/cmd/markdown_test.go +++ b/cmd/schedule-builder/cmd/markdown_test.go @@ -366,6 +366,9 @@ func TestUpdatePatchSchedule(t *testing.T) { EndOfLifeDate: "2025-01-01", MaintenanceModeStartDate: "2024-12-01", }, + { // next not set + Release: "1.29", + }, { // EOL Release: "1.20", EndOfLifeDate: "2023-01-01", @@ -423,6 +426,9 @@ func TestUpdatePatchSchedule(t *testing.T) { }, }, }, + { + Release: "1.29", + }, }, UpcomingReleases: []*PatchRelease{ {