From b581db5be4c9c82a2875e88709772c6cadb9f16d Mon Sep 17 00:00:00 2001 From: Nikolay Edigaryev Date: Fri, 17 Jun 2022 17:53:52 +0300 Subject: [PATCH] OCI: make annotations optional (#130) * OCI: make annotations optional * Don't initialize annotations by default --- Sources/tart/OCI/Manifest.swift | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Sources/tart/OCI/Manifest.swift b/Sources/tart/OCI/Manifest.swift index 3d4eddd..453704c 100644 --- a/Sources/tart/OCI/Manifest.swift +++ b/Sources/tart/OCI/Manifest.swift @@ -11,7 +11,7 @@ struct OCIManifest: Codable, Equatable { var mediaType: String = ociManifestMediaType var config: OCIManifestConfig var layers: [OCIManifestLayer] = Array() - var annotations: Dictionary = Dictionary() + var annotations: Dictionary? init(config: OCIManifestConfig, layers: [OCIManifestLayer], uncompressedDiskSize: UInt64? = nil) { self.config = config @@ -29,7 +29,7 @@ struct OCIManifest: Codable, Equatable { } func uncompressedDiskSize() -> UInt64? { - guard let value = annotations[uncompressedDiskSizeAnnotation] else { + guard let value = annotations?[uncompressedDiskSizeAnnotation] else { return nil }