Skip to content

Commit

Permalink
Don't panic if next release is not set
Browse files Browse the repository at this point in the history
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 <[email protected]>
  • Loading branch information
saschagrunert committed Apr 4, 2024
1 parent 5095b6e commit ef75f74
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 0 deletions.
5 changes: 5 additions & 0 deletions cmd/schedule-builder/cmd/markdown.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
6 changes: 6 additions & 0 deletions cmd/schedule-builder/cmd/markdown_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down Expand Up @@ -423,6 +426,9 @@ func TestUpdatePatchSchedule(t *testing.T) {
},
},
},
{
Release: "1.29",
},
},
UpcomingReleases: []*PatchRelease{
{
Expand Down

0 comments on commit ef75f74

Please sign in to comment.