diff options
| author | Owen T. Heisler <writer@owenh.net> | 2025-12-10 05:31:16 +0000 |
|---|---|---|
| committer | Ludovic Courtès <ludo@gnu.org> | 2025-12-11 15:31:09 +0100 |
| commit | 94b26ff2841b90826968386de0b71a46284d2ee0 (patch) | |
| tree | f178f334b6aa5de6c5446fa5819d7e6a7e69ba4a | |
| parent | 24d0c0a9510c8433a6dee749637b3c324744a68a (diff) | |
services: oci: Fix oci-image value field handling.
* gnu/services/containers.scm (lower-oci-image-state, oci-lowerable-image?):
Remove support for gexps and correctly lower file-like objects.
* doc/guix.texi: Remove gexp from oci-image value field description.
Fixes: guix/guix#3818
Change-Id: Ib812d65b32dd68f8572fcb371ab4521d22e5336c
Signed-off-by: Ludovic Courtès <ludo@gnu.org>
Merges: #3819
| -rw-r--r-- | doc/guix.texi | 2 | ||||
| -rw-r--r-- | gnu/services/containers.scm | 13 |
2 files changed, 7 insertions, 8 deletions
diff --git a/doc/guix.texi b/doc/guix.texi index 439c23350b4..73bd1104691 100644 --- a/doc/guix.texi +++ b/doc/guix.texi | |||
| @@ -45481,7 +45481,7 @@ A string representing the OCI image tag. Defaults to @code{latest}. | |||
| 45481 | @item @code{value} (type: oci-lowerable-image) | 45481 | @item @code{value} (type: oci-lowerable-image) |
| 45482 | A @code{manifest} or @code{operating-system} record that will be lowered | 45482 | A @code{manifest} or @code{operating-system} record that will be lowered |
| 45483 | into an OCI compatible tarball. Otherwise this field's value can be a | 45483 | into an OCI compatible tarball. Otherwise this field's value can be a |
| 45484 | gexp or a file-like object that evaluates to an OCI compatible tarball. | 45484 | file-like object that evaluates to an OCI compatible tarball. |
| 45485 | 45485 | ||
| 45486 | @item @code{pack-options} (default: @code{'()}) (type: list) | 45486 | @item @code{pack-options} (default: @code{'()}) (type: list) |
| 45487 | An optional set of keyword arguments that will be passed to the | 45487 | An optional set of keyword arguments that will be passed to the |
diff --git a/gnu/services/containers.scm b/gnu/services/containers.scm index 6353960a07e..de91e2357da 100644 --- a/gnu/services/containers.scm +++ b/gnu/services/containers.scm | |||
| @@ -1,5 +1,6 @@ | |||
| 1 | ;;; GNU Guix --- Functional package management for GNU | 1 | ;;; GNU Guix --- Functional package management for GNU |
| 2 | ;;; Copyright © 2024, 2025 Giacomo Leidi <therewasa@fishinthecalculator.me> | 2 | ;;; Copyright © 2024, 2025 Giacomo Leidi <therewasa@fishinthecalculator.me> |
| 3 | ;;; Copyright © 2025 Owen T. Heisler <writer@owenh.net> | ||
| 3 | ;;; | 4 | ;;; |
| 4 | ;;; This file is part of GNU Guix. | 5 | ;;; This file is part of GNU Guix. |
| 5 | ;;; | 6 | ;;; |
| @@ -523,7 +524,6 @@ but ~a was found") el)))) | |||
| 523 | (define (oci-lowerable-image? image) | 524 | (define (oci-lowerable-image? image) |
| 524 | (or (manifest? image) | 525 | (or (manifest? image) |
| 525 | (operating-system? image) | 526 | (operating-system? image) |
| 526 | (gexp? image) | ||
| 527 | (file-like? image))) | 527 | (file-like? image))) |
| 528 | 528 | ||
| 529 | (define (string-or-oci-image? image) | 529 | (define (string-or-oci-image? image) |
| @@ -558,8 +558,8 @@ the OCI image.") | |||
| 558 | (value | 558 | (value |
| 559 | (oci-lowerable-image) | 559 | (oci-lowerable-image) |
| 560 | "A @code{manifest} or @code{operating-system} record that will be lowered | 560 | "A @code{manifest} or @code{operating-system} record that will be lowered |
| 561 | into an OCI compatible tarball. Otherwise this field's value can be a gexp | 561 | into an OCI compatible tarball. Otherwise this field's value can be a |
| 562 | or a file-like object that evaluates to an OCI compatible tarball.") | 562 | file-like object that evaluates to an OCI compatible tarball.") |
| 563 | (pack-options | 563 | (pack-options |
| 564 | (list '()) | 564 | (list '()) |
| 565 | "An optional set of keyword arguments that will be passed to the | 565 | "An optional set of keyword arguments that will be passed to the |
| @@ -1080,14 +1080,13 @@ for the OCI runtime volume create command." | |||
| 1080 | target system grafts?)) | 1080 | target system grafts?)) |
| 1081 | ((? operating-system? value) | 1081 | ((? operating-system? value) |
| 1082 | (lower-operating-system value target system)) | 1082 | (lower-operating-system value target system)) |
| 1083 | ((or (? gexp? value) | 1083 | ((? file-like? value) |
| 1084 | (? file-like? value)) | 1084 | (lower-object value)) |
| 1085 | value) | ||
| 1086 | (_ | 1085 | (_ |
| 1087 | (raise | 1086 | (raise |
| 1088 | (formatted-message | 1087 | (formatted-message |
| 1089 | (G_ "oci-image value must contain only manifest, | 1088 | (G_ "oci-image value must contain only manifest, |
| 1090 | operating-system, gexp or file-like records but ~a was found") | 1089 | operating-system, or file-like records but ~a was found") |
| 1091 | value)))) | 1090 | value)))) |
| 1092 | #:target target | 1091 | #:target target |
| 1093 | #:system system))) | 1092 | #:system system))) |
