Skip to content

Commit fda2227

Browse files
committed
Adapt to the OCI spec published under Ironcore Image
1 parent 22b242c commit fda2227

File tree

2 files changed

+9
-9
lines changed

2 files changed

+9
-9
lines changed

internal/controller/serverbootconfiguration_pxe_controller.go

+7-7
Original file line numberDiff line numberDiff line change
@@ -52,10 +52,9 @@ type ServerBootConfigurationPXEReconciler struct {
5252
}
5353

5454
const (
55-
MediaTypeKernel = "application/io.gardenlinux.kernel"
56-
MediaTypeInitrd = "application/io.gardenlinux.initrd"
57-
MediaTypeSquashFS = "application/io.gardenlinux.squashfs"
58-
CNAMEPrefixMetalPXE = "metal_pxe"
55+
MediaTypeKernel = "application/vnd.ironcore.image.kernel"
56+
MediaTypeInitrd = "application/vnd.ironcore.image.initramfs"
57+
MediaTypeSquashFS = "application/vnd.ironcore.image.squashfs"
5958
)
6059

6160
//+kubebuilder:rbac:groups=metal.ironcore.dev,resources=serverbootconfigurations,verbs=get;list;watch
@@ -243,15 +242,16 @@ func (r *ServerBootConfigurationPXEReconciler) getLayerDigestsFromNestedManifest
243242
}
244243

245244
for _, manifest := range indexManifest.Manifests {
246-
if strings.HasPrefix(manifest.Annotations["cname"], CNAMEPrefixMetalPXE) {
247-
if manifest.Annotations["architecture"] == r.Architecture {
245+
platform := manifest.Platform
246+
if manifest.Platform != nil {
247+
if platform.Architecture == r.Architecture {
248248
targetManifestDesc = manifest
249249
break
250250
}
251251
}
252252
}
253253
if targetManifestDesc.Digest == "" {
254-
return "", "", "", fmt.Errorf("failed to find target manifest with cname annotation")
254+
return "", "", "", fmt.Errorf("failed to find target manifest with architecture %s", r.Architecture)
255255
}
256256

257257
nestedData, err := fetchContent(ctx, resolver, name, targetManifestDesc)

internal/controller/serverbootconfiguration_pxe_controller_test.go

+2-2
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ var _ = Describe("ServerBootConfiguration Controller", func() {
6464
ServerRef: corev1.LocalObjectReference{
6565
Name: server.Name,
6666
},
67-
Image: "ghcr.io/gardenlinux/gardenlinux:1758.0",
67+
Image: "ghcr.io/ironcore-dev/os-images/test-image:100.1",
6868
IgnitionSecretRef: &corev1.LocalObjectReference{Name: "foo"},
6969
},
7070
}
@@ -125,7 +125,7 @@ var _ = Describe("ServerBootConfiguration Controller", func() {
125125
ServerRef: corev1.LocalObjectReference{
126126
Name: server.Name,
127127
},
128-
Image: "ghcr.io/gardenlinux/gardenlinux:1770.0-metal_pxe-arm64-1770.0-60d819dd-arm64",
128+
Image: "ghcr.io/ironcore-dev/os-images/test-image:100.1",
129129
IgnitionSecretRef: &corev1.LocalObjectReference{Name: "foo"},
130130
},
131131
}

0 commit comments

Comments
 (0)