File tree Expand file tree Collapse file tree 1 file changed +3
-1
lines changed
Sources/ContainerRegistry Expand file tree Collapse file tree 1 file changed +3
-1
lines changed Original file line number Diff line number Diff line change 1414
1515public extension RegistryClient {
1616 func putManifest( repository: String , reference: String , manifest: ImageManifest ) async throws -> String {
17+ // See https://github.com/opencontainers/distribution-spec/blob/main/spec.md#pushing-manifests
1718 precondition ( repository. count > 0 , " repository must not be an empty string " )
1819 precondition ( reference. count > 0 , " reference must not be an empty string " )
1920
2021 let httpResponse = try await executeRequestThrowing (
2122 // All blob uploads have Content-Type: application/octet-stream on the wire, even if mediatype is different
2223 . put(
2324 registryURLForPath ( " /v2/ \( repository) /manifests/ \( reference) " ) ,
24- contentType: " application/vnd.oci.image.manifest.v1+json "
25+ contentType: manifest . mediaType ?? " application/vnd.oci.image.manifest.v1+json "
2526 ) ,
2627 uploading: manifest,
2728 expectingStatus: . created,
@@ -35,6 +36,7 @@ public extension RegistryClient {
3536 }
3637
3738 func getManifest( repository: String , reference: String ) async throws -> ImageManifest {
39+ // See https://github.com/opencontainers/distribution-spec/blob/main/spec.md#pulling-manifests
3840 precondition ( repository. count > 0 , " repository must not be an empty string " )
3941 precondition ( reference. count > 0 , " reference must not be an empty string " )
4042
You can’t perform that action at this time.
0 commit comments