m/installer/install: take OCI image in Params
install.Params now takes an OCI image. This avoids some duplicate code
to extract info from the OCI image in all places which create
install.Params.
Change-Id: I2430ce1101befaa1b1a4781f592d06ee015a0f99
Reviewed-on: https://review.monogon.dev/c/monogon/+/4297
Reviewed-by: Tim Windelschmidt <tim@monogon.tech>
Tested-by: Jenkins CI
diff --git a/cloud/agent/install.go b/cloud/agent/install.go
index 949a9a7..1ad60fc 100644
--- a/cloud/agent/install.go
+++ b/cloud/agent/install.go
@@ -85,15 +85,6 @@
return fmt.Errorf("failed to fetch OS image: %w", err)
}
- efiPayload, err := osImage.Payload("kernel.efi")
- if err != nil {
- return fmt.Errorf("cannot open EFI payload in OS image: %w", err)
- }
- systemImage, err := osImage.Payload("system")
- if err != nil {
- return fmt.Errorf("cannot open system image in OS image: %w", err)
- }
-
l.Info("OS image config downloaded")
nodeParamsRaw, err := proto.Marshal(req.NodeParameters)
@@ -112,9 +103,7 @@
System: 4096,
Data: 128,
},
- Architecture: osImage.Config.ProductInfo.Architecture(),
- SystemImage: systemImage,
- EFIPayload: efiPayload,
+ OSImage: osImage,
ABLoader: structfs.Bytes(abloader),
NodeParameters: structfs.Bytes(nodeParamsRaw),
Output: rootDev,