Skip to content

Commit 0686b22

Browse files
authored
Fix: image list with zone=all (scaleway#4382)
1 parent 59dcef3 commit 0686b22

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

internal/namespaces/instance/v1/custom_image.go

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -188,7 +188,14 @@ func imageListBuilder(c *core.Command) *core.Command {
188188
req.Public = scw.BoolPtr(false)
189189
client := core.ExtractClient(ctx)
190190
api := instance.NewAPI(client)
191-
listImagesResponse, err := api.ListImages(req, scw.WithAllPages())
191+
192+
opts := []scw.RequestOption{scw.WithAllPages()}
193+
if req.Zone == scw.Zone(core.AllLocalities) {
194+
opts = append(opts, scw.WithZones(api.Zones()...))
195+
req.Zone = ""
196+
}
197+
198+
listImagesResponse, err := api.ListImages(req, opts...)
192199
if err != nil {
193200
return nil, err
194201
}

0 commit comments

Comments
 (0)