From ef75f74531a45a544df18cdee1c147bdd23d714f Mon Sep 17 00:00:00 2001 From: Sascha Grunert Date: Thu, 4 Apr 2024 16:01:16 +0200 Subject: [PATCH] Don't panic if next release is not set Should be usually not the case, but we skip releases from schedule-builder if the `next` field is not available now. Signed-off-by: Sascha Grunert --- cmd/schedule-builder/cmd/markdown.go | 5 +++++ cmd/schedule-builder/cmd/markdown_test.go | 6 ++++++ 2 files changed, 11 insertions(+) diff --git a/cmd/schedule-builder/cmd/markdown.go b/cmd/schedule-builder/cmd/markdown.go index 15e8e356de6..e35bcea890f 100644 --- a/cmd/schedule-builder/cmd/markdown.go +++ b/cmd/schedule-builder/cmd/markdown.go @@ -173,6 +173,11 @@ 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 %s, skipping", sched.Release) + break + } + eolDate, err := time.Parse(refDate, sched.EndOfLifeDate) if err != nil { return fmt.Errorf("parse end of life date: %w", err) diff --git a/cmd/schedule-builder/cmd/markdown_test.go b/cmd/schedule-builder/cmd/markdown_test.go index ea60d5578b6..6c817f56183 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{ {