Skip to content

Commit

Permalink
WIP variants for each platform
Browse files Browse the repository at this point in the history
- Improve OciRegistryDataTask: group image references by name
  • Loading branch information
SgtSilvio committed Jul 5, 2024
1 parent e22f00f commit c1239f4
Showing 1 changed file with 7 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -37,8 +37,8 @@ abstract class OciRegistryDataTask : OciImagesInputTask() {
}
for ((multiArchImage, imageReferences) in multiArchImageAndReferencesPairs) {
blobsDirectory.writeDigestData(multiArchImage.index)
for (imageReference in imageReferences) { // TODO group by name
val repositoryDirectory = repositoriesDirectory.resolve(imageReference.name).createDirectories()
for ((name, tags) in imageReferences.groupBy({ it.name }, { it.tag })) {
val repositoryDirectory = repositoriesDirectory.resolve(name).createDirectories()
val layersDirectory = repositoryDirectory.resolve("_layers").createDirectories()
val manifestsDirectory = repositoryDirectory.resolve("_manifests").createDirectories()
val manifestRevisionsDirectory = manifestsDirectory.resolve("revisions").createDirectories()
Expand All @@ -57,9 +57,11 @@ abstract class OciRegistryDataTask : OciImagesInputTask() {
}
val indexDigest = multiArchImage.index.digest
manifestRevisionsDirectory.writeDigestLink(indexDigest)
val tagDirectory = manifestsDirectory.resolve("tags").resolve(imageReference.tag).createDirectories()
tagDirectory.writeTagLink(indexDigest)
tagDirectory.resolve("index").createDirectories().writeDigestLink(indexDigest)
for (tag in tags) {
val tagDirectory = manifestsDirectory.resolve("tags").resolve(tag).createDirectories()
tagDirectory.writeTagLink(indexDigest)
tagDirectory.resolve("index").createDirectories().writeDigestLink(indexDigest)
}
}
}
}
Expand Down

0 comments on commit c1239f4

Please sign in to comment.