Skip to content

Commit

Permalink
Merge pull request #3551 from saschagrunert/next-nil
Browse files Browse the repository at this point in the history
Don't panic if next release is not set
  • Loading branch information
k8s-ci-robot authored Apr 4, 2024
2 parents 5095b6e + ef75f74 commit 0da4282
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 0da4282

Please sign in to comment.