From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from gate001.proxmox.com (gate001.proxmox.com [45.144.208.40]) by lore.proxmox.com (Postfix) with ESMTPS id 283C21FF0B6 for ; Thu, 12 Nov 2026 15:16:28 +0100 (CET) Received: from gate001.proxmox.com (localhost.localdomain [127.0.0.1]) by gate001.proxmox.com (Proxmox) with ESMTP id 8AC1F2166E; Thu, 12 Nov 2026 15:16:24 +0100 (CET) From: Filip Schauer To: pve-devel@lists.proxmox.com Subject: [PATCH proxmox-perl-rs 22/26] pve-rs: oci: expose pull_image_to_oci_storage Date: Thu, 12 Nov 2026 15:10:49 +0100 Message-ID: <20261112141109.137298-23-f.schauer@proxmox.com> X-Mailer: git-send-email 2.47.3 In-Reply-To: <20261112141109.137298-1-f.schauer@proxmox.com> References: <20261112141109.137298-1-f.schauer@proxmox.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Bm-Milter-Handled: 55990f41-d878-4baa-be0a-ee34c49e34d2 X-Bm-Transport-Timestamp: 1794492981881 X-SPAM-LEVEL: Spam detection results: 0 AWL 0.169 Adjusted score from AWL reputation of From: address DMARC_MISSING 0.1 Missing DMARC policy KAM_DMARC_STATUS 0.01 Test Rule for DKIM or SPF Failure with Strict Alignment (newer systems) RCVD_IN_DNSWL_MED -2.3 Sender listed at https://www.dnswl.org/, medium trust SPF_HELO_NONE 0.001 SPF: HELO does not publish an SPF Record SPF_PASS -0.001 SPF: sender matches SPF record Message-ID-Hash: EJ5DVPUOGPW5OM63BICA555RERQFKHED X-Message-ID-Hash: EJ5DVPUOGPW5OM63BICA555RERQFKHED X-MailFrom: f.schauer@proxmox.com X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; loop; banned-address; emergency; member-moderation; nonmember-moderation; administrivia; implicit-dest; max-recipients; max-size; news-moderation; no-subject; digests; suspicious-header X-Mailman-Version: 3.3.10 Precedence: list List-Id: Proxmox VE development discussion List-Help: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: Signed-off-by: Filip Schauer --- pve-rs/src/bindings/oci.rs | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) diff --git a/pve-rs/src/bindings/oci.rs b/pve-rs/src/bindings/oci.rs index bbe6b34..aec7985 100644 --- a/pve-rs/src/bindings/oci.rs +++ b/pve-rs/src/bindings/oci.rs @@ -73,4 +73,32 @@ pub mod pve_rs_oci { let reference = Reference::from_str(reference)?; Ok(proxmox_oci::pull_image_as_tar(&reference, auth, tar_path)?) } + + /// Pull an OCI image from a registry and save it to a storage with the "oci" content type. + /// + /// This cleans up unfinished layers on error. However it does not remove layers that were + /// already successfully written, even if the download fails at another layer. + /// + /// # Arguments + /// + /// * `reference` - OCI reference specifying the image repository and tag/digest to pull + /// * `auth` - Authentication credentials/method to access the registry + /// * `oci_storage_path` - Path to the target "oci" storage directory + /// + /// # Returns + /// + /// On success, this returns the Image ID of the pulled image in the format `-`. + #[export] + pub fn pull_image_to_oci_storage( + reference: &str, + auth: RegistryAuth, + oci_storage_path: &str, + ) -> Result { + let reference = Reference::from_str(reference)?; + Ok(proxmox_oci::pull_image_to_oci_storage( + &reference, + auth, + oci_storage_path, + )?) + } } -- 2.47.3