Skip to content

Conversation

@wobito
Copy link

@wobito wobito commented Jul 31, 2024

allow the config to setup the artifactType when the config mediatype is of empty type

@wobito wobito marked this pull request as ready for review July 31, 2024 17:47
Copy link
Member

@tri-adam tri-adam left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

One question and suggestion about the naming of the API. Thanks!

@wobito
Copy link
Author

wobito commented Jul 31, 2024

All your suggestions I initially had, but changed it.

Since I'm only setting the artifact type on the config I opted for the name structure.

Let's huddle tomorrow if you have time.

Signed-off-by: Adrian Wobito <[email protected]>
@tri-adam
Copy link
Member

tri-adam commented Aug 1, 2024

The code looks good, but as discussed, I think the resulting image manifest has the artifactType under the config block, rather than under the top level of the manifest?

For example, pkg/mutate/testdata/TestApply/SetConfigArtifactType/manifest.golden is currently:

{
  "schemaVersion": 2,
  "mediaType": "application/vnd.docker.distribution.manifest.v2+json",
  "config": {
    "mediaType": "application/vnd.oci.empty.v1+json",
    "size": 2,
    "digest": "sha256:44136fa355b3678a1146ad16f7e8649e94fb4fc21fe77e8310c060f61caaff8a",
    "artifactType": "application/vnd.sylabs.container"
  },
  "layers": [
    {
      "mediaType": "application/vnd.docker.image.rootfs.diff.tar.gzip",
      "size": 3208,
      "digest": "sha256:7050e35b49f5e348c4809f5eff915842962cb813f32062d3bbdd35c750dd7d01"
    }
  ]
}

But I think, according to the spec this should be:

{
  "schemaVersion": 2,
  "mediaType": "application/vnd.docker.distribution.manifest.v2+json",
  "artifactType": "application/vnd.sylabs.container"
  "config": {
    "mediaType": "application/vnd.oci.empty.v1+json",
    "size": 2,
    "digest": "sha256:44136fa355b3678a1146ad16f7e8649e94fb4fc21fe77e8310c060f61caaff8a",
  },
  "layers": [
    {
      "mediaType": "application/vnd.docker.image.rootfs.diff.tar.gzip",
      "size": 3208,
      "digest": "sha256:7050e35b49f5e348c4809f5eff915842962cb813f32062d3bbdd35c750dd7d01"
    }
  ]
}

Potentially related: google/go-containerregistry#1537, google/go-containerregistry#1832

@wobito
Copy link
Author

wobito commented Aug 6, 2024

looks like its being worked on:
google/go-containerregistry#1931

@tri-adam tri-adam marked this pull request as draft September 26, 2024 17:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants