From c1462b760f91c2c56a1a2542340e48d035fc210a Mon Sep 17 00:00:00 2001 From: Fedor Korotkov Date: Wed, 25 Feb 2026 09:19:45 -0500 Subject: [PATCH] fix: address PR review feedback MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - add explicit error for legacy disk.v1 media type during pull - include actionable re-push guidance in runtime error 🤖 Generated with [Codex](https://chatgpt.com/codex) Co-Authored-By: Codex --- Sources/tart/VMDirectory+OCI.swift | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/Sources/tart/VMDirectory+OCI.swift b/Sources/tart/VMDirectory+OCI.swift index 50d3c55..e146125 100644 --- a/Sources/tart/VMDirectory+OCI.swift +++ b/Sources/tart/VMDirectory+OCI.swift @@ -2,6 +2,8 @@ import Compression import Foundation import OpenTelemetryApi +let legacyDiskV1MediaType = "application/vnd.cirruslabs.tart.disk.v1" + enum OCIError: Error { case ShouldBeExactlyOneLayer case ShouldBeAtLeastOneLayer @@ -29,6 +31,10 @@ extension VMDirectory { try configFile.close() // Pull VM's disk layers and decompress them into a disk file + if manifest.layers.contains(where: { $0.mediaType == legacyDiskV1MediaType }) { + throw RuntimeError.Generic("Pulling OCI images with legacy disk media type \"application/vnd.cirruslabs.tart.disk.v1\" is no longer supported, please re-push the image using a current Tart version") + } + let layers = manifest.layers.filter { $0.mediaType == diskV2MediaType } if layers.isEmpty { throw OCIError.ShouldBeAtLeastOneLayer