1
0
mirror of https://git.savannah.gnu.org/git/guix.git synced 2026-04-06 21:20:33 +02:00

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
This commit is contained in:
Owen T. Heisler
2025-12-10 05:31:16 +00:00
committed by Ludovic Courtès
parent 24d0c0a951
commit 94b26ff284
2 changed files with 7 additions and 8 deletions

View File

@@ -45481,7 +45481,7 @@ A string representing the OCI image tag. Defaults to @code{latest}.
@item @code{value} (type: oci-lowerable-image) @item @code{value} (type: oci-lowerable-image)
A @code{manifest} or @code{operating-system} record that will be lowered A @code{manifest} or @code{operating-system} record that will be lowered
into an OCI compatible tarball. Otherwise this field's value can be a into an OCI compatible tarball. Otherwise this field's value can be a
gexp or a file-like object that evaluates to an OCI compatible tarball. file-like object that evaluates to an OCI compatible tarball.
@item @code{pack-options} (default: @code{'()}) (type: list) @item @code{pack-options} (default: @code{'()}) (type: list)
An optional set of keyword arguments that will be passed to the An optional set of keyword arguments that will be passed to the

View File

@@ -1,5 +1,6 @@
;;; GNU Guix --- Functional package management for GNU ;;; GNU Guix --- Functional package management for GNU
;;; Copyright © 2024, 2025 Giacomo Leidi <therewasa@fishinthecalculator.me> ;;; Copyright © 2024, 2025 Giacomo Leidi <therewasa@fishinthecalculator.me>
;;; Copyright © 2025 Owen T. Heisler <writer@owenh.net>
;;; ;;;
;;; This file is part of GNU Guix. ;;; This file is part of GNU Guix.
;;; ;;;
@@ -523,7 +524,6 @@ but ~a was found") el))))
(define (oci-lowerable-image? image) (define (oci-lowerable-image? image)
(or (manifest? image) (or (manifest? image)
(operating-system? image) (operating-system? image)
(gexp? image)
(file-like? image))) (file-like? image)))
(define (string-or-oci-image? image) (define (string-or-oci-image? image)
@@ -558,8 +558,8 @@ the OCI image.")
(value (value
(oci-lowerable-image) (oci-lowerable-image)
"A @code{manifest} or @code{operating-system} record that will be lowered "A @code{manifest} or @code{operating-system} record that will be lowered
into an OCI compatible tarball. Otherwise this field's value can be a gexp into an OCI compatible tarball. Otherwise this field's value can be a
or a file-like object that evaluates to an OCI compatible tarball.") file-like object that evaluates to an OCI compatible tarball.")
(pack-options (pack-options
(list '()) (list '())
"An optional set of keyword arguments that will be passed to the "An optional set of keyword arguments that will be passed to the
@@ -1080,14 +1080,13 @@ for the OCI runtime volume create command."
target system grafts?)) target system grafts?))
((? operating-system? value) ((? operating-system? value)
(lower-operating-system value target system)) (lower-operating-system value target system))
((or (? gexp? value) ((? file-like? value)
(? file-like? value)) (lower-object value))
value)
(_ (_
(raise (raise
(formatted-message (formatted-message
(G_ "oci-image value must contain only manifest, (G_ "oci-image value must contain only manifest,
operating-system, gexp or file-like records but ~a was found") operating-system, or file-like records but ~a was found")
value)))) value))))
#:target target #:target target
#:system system))) #:system system)))