Skip to content

Commit

Permalink
Fix: image list with zone=all (#4382)
Browse files Browse the repository at this point in the history
  • Loading branch information
remyleone authored Dec 26, 2024
1 parent 59dcef3 commit 0686b22
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion internal/namespaces/instance/v1/custom_image.go
Original file line number Diff line number Diff line change
Expand Up @@ -188,7 +188,14 @@ func imageListBuilder(c *core.Command) *core.Command {
req.Public = scw.BoolPtr(false)
client := core.ExtractClient(ctx)
api := instance.NewAPI(client)
listImagesResponse, err := api.ListImages(req, scw.WithAllPages())

opts := []scw.RequestOption{scw.WithAllPages()}
if req.Zone == scw.Zone(core.AllLocalities) {
opts = append(opts, scw.WithZones(api.Zones()...))
req.Zone = ""
}

listImagesResponse, err := api.ListImages(req, opts...)
if err != nil {
return nil, err
}
Expand Down

0 comments on commit 0686b22

Please sign in to comment.