OCI: make annotations optional (#130)

* OCI: make annotations optional

* Don't initialize annotations by default
This commit is contained in:
Nikolay Edigaryev 2022-06-17 17:53:52 +03:00 committed by GitHub
parent 8ed2ce159f
commit b581db5be4
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 2 additions and 2 deletions

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
}