Skip to content

Commit

Permalink
janitor: fix listing (#632)
Browse files Browse the repository at this point in the history
The nested ListOptions struct is a pointer that needs to be initialized.
Otherwise, the code will crash with a nil pointer exception when
incrementing the page.
  • Loading branch information
Timo Reimann authored Sep 4, 2024
1 parent 18c1328 commit 7fabc74
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion hack/do-janitor/do-janitor.go
Original file line number Diff line number Diff line change
Expand Up @@ -187,7 +187,9 @@ func volumeList(ctx context.Context, client *godo.Client) ([]godo.Volume, error)
list := []godo.Volume{}

// create options. initially, these will be blank
opt := &godo.ListVolumeParams{}
opt := &godo.ListVolumeParams{
ListOptions: &godo.ListOptions{},
}
for {
volumes, resp, err := client.Storage.ListVolumes(ctx, opt)
if err != nil {
Expand Down

0 comments on commit 7fabc74

Please sign in to comment.