Skip to content

Commit 112952f

Browse files
frieggergonzolinolukasfrank
authored
Support OCI multi-arch images (#820)
Resolve the image of the corresponding architecture by dynamically instantiating a docker registry with the correct platform. This approach will also work once credentials are handed in per image. Currently hard codes `linux`. Fixes #723 --------- Co-authored-by: Daniel Gonzalez <[email protected]> Co-authored-by: Lukas Frank <[email protected]>
1 parent 130b6b4 commit 112952f

File tree

9 files changed

+281
-201
lines changed

9 files changed

+281
-201
lines changed

api/constants.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,4 +10,6 @@ const (
1010
ManagerLabel = "ceph-provider.ironcore.dev/manager"
1111
BucketManager = "ceph-bucket-provider"
1212
VolumeManager = "ceph-volume-provider"
13+
14+
MachineArchitectureLabel = "common.ironcore.dev/architecture"
1315
)

api/image.go

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -28,12 +28,13 @@ const (
2828
)
2929

3030
type ImageSpec struct {
31-
Size uint64 `json:"size"`
32-
WWN string `json:"wwn"`
33-
Limits Limits `json:"limits"`
34-
Image string `json:"image"`
35-
SnapshotRef *string `json:"snapshotRef"`
36-
Encryption *EncryptionSpec `json:"encryption"`
31+
Size uint64 `json:"size"`
32+
WWN string `json:"wwn"`
33+
Limits Limits `json:"limits"`
34+
Image string `json:"image"`
35+
ImageArchitecture *string `json:"imageArchitecture"`
36+
SnapshotRef *string `json:"snapshotRef"`
37+
Encryption *EncryptionSpec `json:"encryption"`
3738
}
3839

3940
type EncryptionType string

cmd/volumeprovider/app/app.go

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,6 @@ import (
2020
"github.com/ironcore-dev/ceph-provider/internal/strategy"
2121
"github.com/ironcore-dev/ceph-provider/internal/vcr"
2222
"github.com/ironcore-dev/ceph-provider/internal/volumeserver"
23-
"github.com/ironcore-dev/ironcore-image/oci/remote"
2423
"github.com/ironcore-dev/ironcore/broker/common"
2524
iriv1alpha1 "github.com/ironcore-dev/ironcore/iri/apis/volume/v1alpha1"
2625
"github.com/ironcore-dev/provider-utils/eventutils/event"
@@ -246,17 +245,11 @@ func Run(ctx context.Context, opts Options) error {
246245
return fmt.Errorf("failed to initialize snapshot events: %w", err)
247246
}
248247

249-
reg, err := remote.DockerRegistry(nil)
250-
if err != nil {
251-
return fmt.Errorf("failed to initialize docker registry: %w", err)
252-
}
253-
254248
volumeEventStore := eventrecorder.NewEventStore(log, opts.Ceph.VolumeEventStoreOptions)
255249

256250
imageReconciler, err := controllers.NewImageReconciler(
257251
log.WithName("image-reconciler"),
258252
conn,
259-
reg,
260253
imageStore, snapshotStore,
261254
volumeEventStore,
262255
imageEvents,
@@ -287,7 +280,6 @@ func Run(ctx context.Context, opts Options) error {
287280
snapshotReconciler, err := controllers.NewSnapshotReconciler(
288281
log.WithName("snapshot-reconciler"),
289282
conn,
290-
reg,
291283
snapshotStore,
292284
imageStore,
293285
snapshotEvents,

go.mod

Lines changed: 55 additions & 46 deletions
Original file line numberDiff line numberDiff line change
@@ -1,34 +1,35 @@
11
module github.com/ironcore-dev/ceph-provider
22

3-
go 1.24.0
3+
go 1.24.1
44

5-
toolchain go1.24.1
5+
toolchain go1.24.11
66

77
require (
88
github.com/blang/semver/v4 v4.0.0
99
github.com/ceph/go-ceph v0.37.0
1010
github.com/containerd/containerd v1.7.30
1111
github.com/go-logr/logr v1.4.3
1212
github.com/google/addlicense v1.2.0
13-
github.com/ironcore-dev/controller-utils v0.10.0
14-
github.com/ironcore-dev/ironcore v0.2.5-0.20250923112018-311a2542fc90
15-
github.com/ironcore-dev/ironcore-image v0.2.5
13+
github.com/ironcore-dev/controller-utils v0.11.0
14+
github.com/ironcore-dev/ironcore v0.2.5-0.20260114075630-5ab59ba249c8
15+
github.com/ironcore-dev/ironcore-image v0.2.6
1616
github.com/ironcore-dev/provider-utils v0.0.0-20250617134512-c47138779fed
1717
github.com/kube-object-storage/lib-bucket-provisioner v0.0.0-20221122204822-d1a8c34382f1
1818
github.com/onsi/ginkgo/v2 v2.27.5
1919
github.com/onsi/gomega v1.39.0
20+
github.com/opencontainers/image-spec v1.1.1
2021
github.com/pkg/errors v0.9.1
2122
github.com/rook/rook/pkg/apis v0.0.0-20250716205136-e4da184ce30a
2223
github.com/spf13/cobra v1.10.2
2324
github.com/spf13/pflag v1.0.10
2425
go.uber.org/zap v1.27.1
2526
golang.org/x/sync v0.19.0
2627
google.golang.org/grpc v1.78.0
27-
k8s.io/api v0.33.4
28-
k8s.io/apimachinery v0.33.4
29-
k8s.io/client-go v0.33.4
30-
k8s.io/utils v0.0.0-20250604170112-4c0f3b243397
31-
sigs.k8s.io/controller-runtime v0.21.0
28+
k8s.io/api v0.34.1
29+
k8s.io/apimachinery v0.34.1
30+
k8s.io/client-go v0.34.1
31+
k8s.io/utils v0.0.0-20251002143259-bc988d571ff4
32+
sigs.k8s.io/controller-runtime v0.22.3
3233
)
3334

3435
require (
@@ -38,7 +39,7 @@ require (
3839
github.com/beorn7/perks v1.0.1 // indirect
3940
github.com/bmatcuk/doublestar/v4 v4.8.1 // indirect
4041
github.com/cenkalti/backoff/v4 v4.3.0 // indirect
41-
github.com/cenkalti/backoff/v5 v5.0.2 // indirect
42+
github.com/cenkalti/backoff/v5 v5.0.3 // indirect
4243
github.com/cespare/xxhash/v2 v2.3.0 // indirect
4344
github.com/containerd/cgroups/v3 v3.0.5 // indirect
4445
github.com/containerd/continuity v0.4.5 // indirect
@@ -49,34 +50,45 @@ require (
4950
github.com/containernetworking/cni v1.3.0 // indirect
5051
github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc // indirect
5152
github.com/distribution/reference v0.6.0 // indirect
52-
github.com/docker/cli v28.1.1+incompatible // indirect
53+
github.com/docker/cli v28.5.1+incompatible // indirect
5354
github.com/docker/distribution v2.8.3+incompatible // indirect
54-
github.com/docker/docker v28.1.1+incompatible // indirect
55+
github.com/docker/docker v28.5.1+incompatible // indirect
5556
github.com/docker/docker-credential-helpers v0.9.3 // indirect
56-
github.com/docker/go-connections v0.5.0 // indirect
57+
github.com/docker/go-connections v0.6.0 // indirect
5758
github.com/docker/go-events v0.0.0-20250114142523-c867878c5e32 // indirect
5859
github.com/docker/go-metrics v0.0.1 // indirect
59-
github.com/emicklei/go-restful/v3 v3.12.2 // indirect
60+
github.com/emicklei/go-restful/v3 v3.13.0 // indirect
6061
github.com/evanphx/json-patch/v5 v5.9.11 // indirect
6162
github.com/felixge/httpsnoop v1.0.4 // indirect
6263
github.com/fsnotify/fsnotify v1.9.0 // indirect
63-
github.com/fxamacker/cbor/v2 v2.8.0 // indirect
64+
github.com/fxamacker/cbor/v2 v2.9.0 // indirect
6465
github.com/go-jose/go-jose/v4 v4.1.3 // indirect
6566
github.com/go-logr/stdr v1.2.2 // indirect
6667
github.com/go-logr/zapr v1.3.0 // indirect
67-
github.com/go-openapi/jsonpointer v0.21.1 // indirect
68-
github.com/go-openapi/jsonreference v0.21.0 // indirect
69-
github.com/go-openapi/swag v0.23.1 // indirect
68+
github.com/go-openapi/jsonpointer v0.22.1 // indirect
69+
github.com/go-openapi/jsonreference v0.21.2 // indirect
70+
github.com/go-openapi/swag v0.25.1 // indirect
71+
github.com/go-openapi/swag/cmdutils v0.25.1 // indirect
72+
github.com/go-openapi/swag/conv v0.25.1 // indirect
73+
github.com/go-openapi/swag/fileutils v0.25.1 // indirect
74+
github.com/go-openapi/swag/jsonname v0.25.1 // indirect
75+
github.com/go-openapi/swag/jsonutils v0.25.1 // indirect
76+
github.com/go-openapi/swag/loading v0.25.1 // indirect
77+
github.com/go-openapi/swag/mangling v0.25.1 // indirect
78+
github.com/go-openapi/swag/netutils v0.25.1 // indirect
79+
github.com/go-openapi/swag/stringutils v0.25.1 // indirect
80+
github.com/go-openapi/swag/typeutils v0.25.1 // indirect
81+
github.com/go-openapi/swag/yamlutils v0.25.1 // indirect
7082
github.com/go-task/slim-sprig/v3 v3.0.0 // indirect
7183
github.com/gogo/protobuf v1.3.2 // indirect
7284
github.com/golang/groupcache v0.0.0-20241129210726-2c02b8208cf8 // indirect
7385
github.com/google/btree v1.1.3 // indirect
74-
github.com/google/gnostic-models v0.6.9 // indirect
86+
github.com/google/gnostic-models v0.7.0 // indirect
7587
github.com/google/go-cmp v0.7.0 // indirect
76-
github.com/google/pprof v0.0.0-20250820193118-f64d9cf942d6 // indirect
88+
github.com/google/pprof v0.0.0-20251007162407-5df77e3f7d1d // indirect
7789
github.com/google/uuid v1.6.0 // indirect
7890
github.com/gorilla/mux v1.8.1 // indirect
79-
github.com/grpc-ecosystem/grpc-gateway/v2 v2.26.3 // indirect
91+
github.com/grpc-ecosystem/grpc-gateway/v2 v2.27.3 // indirect
8092
github.com/hashicorp/errwrap v1.1.0 // indirect
8193
github.com/hashicorp/go-cleanhttp v0.5.2 // indirect
8294
github.com/hashicorp/go-multierror v1.1.1 // indirect
@@ -90,66 +102,63 @@ require (
90102
github.com/hashicorp/vault/api/auth/approle v0.9.0 // indirect
91103
github.com/hashicorp/vault/api/auth/kubernetes v0.9.0 // indirect
92104
github.com/inconshreveable/mousetrap v1.1.0 // indirect
93-
github.com/josharian/intern v1.0.0 // indirect
94105
github.com/json-iterator/go v1.1.12 // indirect
95106
github.com/k8snetworkplumbingwg/network-attachment-definition-client v1.7.6 // indirect
96107
github.com/klauspost/compress v1.18.0 // indirect
97108
github.com/libopenstorage/secrets v0.0.0-20240416031220-a17cf7f72c6c // indirect
98-
github.com/mailru/easyjson v0.9.0 // indirect
99109
github.com/mitchellh/go-homedir v1.1.0 // indirect
100110
github.com/mitchellh/mapstructure v1.5.0 // indirect
101111
github.com/moby/locker v1.0.1 // indirect
102112
github.com/moby/sys/mountinfo v0.7.2 // indirect
103113
github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd // indirect
104-
github.com/modern-go/reflect2 v1.0.2 // indirect
114+
github.com/modern-go/reflect2 v1.0.3-0.20250322232337-35a7c28c31ee // indirect
105115
github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822 // indirect
106116
github.com/opencontainers/go-digest v1.0.0 // indirect
107-
github.com/opencontainers/image-spec v1.1.1 // indirect
108117
github.com/openshift/api v0.0.0-20250620202921-c3cf9bb5ccab // indirect
109-
github.com/prometheus/client_golang v1.22.0 // indirect
118+
github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2 // indirect
119+
github.com/prometheus/client_golang v1.23.2 // indirect
110120
github.com/prometheus/client_model v0.6.2 // indirect
111-
github.com/prometheus/common v0.64.0 // indirect
112-
github.com/prometheus/procfs v0.16.1 // indirect
121+
github.com/prometheus/common v0.67.1 // indirect
122+
github.com/prometheus/procfs v0.19.1 // indirect
113123
github.com/ryanuber/go-glob v1.0.0 // indirect
114124
github.com/sirupsen/logrus v1.9.3 // indirect
115125
github.com/x448/float16 v0.8.4 // indirect
116126
go.opentelemetry.io/auto/sdk v1.2.1 // indirect
117-
go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.61.0 // indirect
127+
go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.63.0 // indirect
118128
go.opentelemetry.io/otel v1.38.0 // indirect
119-
go.opentelemetry.io/otel/exporters/otlp/otlptrace v1.36.0 // indirect
120-
go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc v1.36.0 // indirect
129+
go.opentelemetry.io/otel/exporters/otlp/otlptrace v1.38.0 // indirect
130+
go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc v1.38.0 // indirect
121131
go.opentelemetry.io/otel/metric v1.38.0 // indirect
122132
go.opentelemetry.io/otel/sdk v1.38.0 // indirect
123133
go.opentelemetry.io/otel/trace v1.38.0 // indirect
124-
go.opentelemetry.io/proto/otlp v1.7.0 // indirect
134+
go.opentelemetry.io/proto/otlp v1.8.0 // indirect
125135
go.uber.org/multierr v1.11.0 // indirect
126-
go.yaml.in/yaml/v2 v2.4.2 // indirect
136+
go.yaml.in/yaml/v2 v2.4.3 // indirect
127137
go.yaml.in/yaml/v3 v3.0.4 // indirect
128138
golang.org/x/mod v0.29.0 // indirect
129139
golang.org/x/net v0.47.0 // indirect
130140
golang.org/x/oauth2 v0.32.0 // indirect
131-
golang.org/x/sys v0.38.0 // indirect
141+
golang.org/x/sys v0.40.0 // indirect
132142
golang.org/x/term v0.37.0 // indirect
133143
golang.org/x/text v0.31.0 // indirect
134-
golang.org/x/time v0.12.0 // indirect
144+
golang.org/x/time v0.14.0 // indirect
135145
golang.org/x/tools v0.38.0 // indirect
136146
gomodules.xyz/jsonpatch/v2 v2.5.0 // indirect
137147
google.golang.org/genproto/googleapis/api v0.0.0-20251029180050-ab9386a59fda // indirect
138148
google.golang.org/genproto/googleapis/rpc v0.0.0-20251029180050-ab9386a59fda // indirect
139-
google.golang.org/protobuf v1.36.10 // indirect
140-
gopkg.in/evanphx/json-patch.v4 v4.12.0 // indirect
149+
google.golang.org/protobuf v1.36.11 // indirect
150+
gopkg.in/evanphx/json-patch.v4 v4.13.0 // indirect
141151
gopkg.in/inf.v0 v0.9.1 // indirect
142-
gopkg.in/yaml.v3 v3.0.1 // indirect
143-
k8s.io/apiextensions-apiserver v0.33.3 // indirect
144-
k8s.io/apiserver v0.33.3 // indirect
145-
k8s.io/component-base v0.33.3 // indirect
152+
k8s.io/apiextensions-apiserver v0.34.1 // indirect
153+
k8s.io/apiserver v0.34.1 // indirect
154+
k8s.io/component-base v0.34.1 // indirect
146155
k8s.io/klog/v2 v2.130.1 // indirect
147-
k8s.io/kube-openapi v0.0.0-20250610211856-8b98d1ed966a // indirect
148-
oras.land/oras-go v1.2.6 // indirect
156+
k8s.io/kube-openapi v0.0.0-20250910181357-589584f1c912 // indirect
157+
oras.land/oras-go v1.2.7 // indirect
149158
sigs.k8s.io/apiserver-network-proxy/konnectivity-client v0.33.0 // indirect
150-
sigs.k8s.io/json v0.0.0-20241014173422-cfa47c3a1cc8 // indirect
159+
sigs.k8s.io/json v0.0.0-20250730193827-2d320260d730 // indirect
151160
sigs.k8s.io/randfill v1.0.0 // indirect
152-
sigs.k8s.io/structured-merge-diff/v4 v4.7.0 // indirect
161+
sigs.k8s.io/structured-merge-diff/v6 v6.3.0 // indirect
153162
sigs.k8s.io/yaml v1.6.0 // indirect
154163
)
155164

0 commit comments

Comments
 (0)