Compare commits

..
1 Commits
Author SHA1 Message Date
Nikolay Edigaryev b581db5be4 OCI: make annotations optional (#130)
* OCI: make annotations optional

* Don't initialize annotations by default
2022-06-17 10:53:52 -04:00
+2 -2
View File
@@ -11,7 +11,7 @@ struct OCIManifest: Codable, Equatable {
var mediaType: String = ociManifestMediaType
var config: OCIManifestConfig
var layers: [OCIManifestLayer] = Array()
var annotations: Dictionary<String, String> = Dictionary()
var annotations: Dictionary<String, String>?
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
}