Skip to content

Commit f67966e

Browse files
authored
Fix Image Listing (#22)
When listing images, unscoped, OpenStack will error if someone has a shared image, rather than filtering it out, sigh. Manually filter on public images.
1 parent 285673c commit f67966e

File tree

2 files changed

+7
-3
lines changed

2 files changed

+7
-3
lines changed

charts/region/Chart.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,8 @@ description: A Helm chart for deploying Unikorn's Region Controller
44

55
type: application
66

7-
version: v0.1.14
8-
appVersion: v0.1.14
7+
version: v0.1.15
8+
appVersion: v0.1.15
99

1010
icon: https://raw.githubusercontent.com/unikorn-cloud/assets/main/images/logos/dark-on-light/icon.png
1111

pkg/providers/openstack/image.go

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -181,7 +181,11 @@ func (c *ImageClient) Images(ctx context.Context) ([]images.Image, error) {
181181
_, span := tracer.Start(ctx, "/imageservice/v2/images", trace.WithSpanKind(trace.SpanKindClient))
182182
defer span.End()
183183

184-
page, err := images.List(c.client, &images.ListOpts{}).AllPages(ctx)
184+
opts := &images.ListOpts{
185+
Visibility: images.ImageVisibilityPublic,
186+
}
187+
188+
page, err := images.List(c.client, opts).AllPages(ctx)
185189
if err != nil {
186190
return nil, err
187191
}

0 commit comments

Comments
 (0)