projects/guix·commit 6f7a669c

machine: hetzner: Restrict default image selection to system images.

6f7a669c · Fabio Natali <[email protected]> · 2026-10-06 17:29:15 +01:00

The images API also returns backups, which retain their source system's OS
flavour and version but have no name. Consequently, a backup may be selected as
the latest Debian image, causing server creation to fail while serializing the
image name.

* gnu/machine/hetzner/http.scm (%hetzner-default-server-image): Request only
  images of type "system".

Change-Id: I47e5ab7a9be0b845979ce0161f45b96045b4c724
Commit
6f7a669c334efd12524ba62aaed87e5fc4eca7e3
Parents
e21d4354

Changes

1 files changed · +6 −4

FileStatusAddDelContent
gnu/machine/hetzner/http.scmmodified+6−4View file

gnu/machine/hetzner/http.scm

View file
diff --git a/gnu/machine/hetzner/http.scm b/gnu/machine/hetzner/http.scm
index 6702a75..b338780 100644
--- a/gnu/machine/hetzner/http.scm
+++ b/gnu/machine/hetzner/http.scm
@@ -193,10 +193,12 @@
(mlambda (api)
"Return the latest Debian image available. This image gets used for the
initial system provisioning phase, before Guix System takes over."
- (let ((debian-images (filter (lambda (image)
- (string=? "debian"
- (hetzner-image-os-flavor image)))
- (hetzner-api-images api))))
+ (let* ((system-images (hetzner-api-images api
+ #:params '(("type" . "system"))))
+ (debian-images (filter (lambda (image)
+ (string=? "debian"
+ (hetzner-image-os-flavor image)))
+ system-images)))
(hetzner-image-name
(last (sort debian-images
(lambda (x y)