Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add: override artifactType #74

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from
Draft

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!

pkg/mutate/mutate.go Outdated Show resolved Hide resolved
pkg/mutate/image.go Outdated Show resolved Hide resolved
pkg/mutate/image.go Outdated Show resolved Hide resolved
pkg/mutate/mutate_test.go Outdated Show resolved Hide resolved
@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