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

components written to oci repository is unreadable #1

Open
reshnm opened this issue Oct 4, 2023 · 0 comments
Open

components written to oci repository is unreadable #1

reshnm opened this issue Oct 4, 2023 · 0 comments

Comments

@reshnm
Copy link

reshnm commented Oct 4, 2023

Is was writing a component to an oci repository:

// create a new component
cmp := builder.New("ocm.software/test", "v1.0.0", "acme.org")

// create resources
resources := []v2.Resource{
file.Resource("data", "config.yaml"),
oci.Resource("web-server", "docker.io/nginx:1.25.2"),
oci.Resource("redis", "docker.io/redis:latest"),
}

// add the resources to the component
cmp = mutate.WithResources(cmp, resources...)

// setup the remote OCI repository
repo, err := oci.Repository("ghcr.io/reshnm/components")
if err != nil {
log.Fatal(err)
}

// write the component to the remote repository
if err := repo.Write(cmp); err != nil {
log.Fatal(err)
}

The component was writte but is not readable by the oci client:

ocm get componentversions --repo OCIRegistry::ghcr.io/reshnm/components ocm.software/test
Error: error processing "ocm.software/test": artifact is no component: application/vnd.docker.container.image.v1+json

Manifest:

{
  "digest": "sha256:e19e2efcf5d3146dfc4eb47e895df38d03bf22f01210711e25197b7e6f008346",
  "mediaType": "application/vnd.oci.image.manifest.v1+json",
  "size": 414,
  "config": {
    "digest": "sha256:f60f3adf813135175cc0f45117e992c079c97795569721a09a5a9901c31affc0",
    "mediaType": "application/vnd.docker.container.image.v1+json",
    "size": 233
  },
  "layers": [
    {
      "digest": "sha256:e19464a24499fead0c3dc0ef28b795e67cf032895de36bc7c07b95a0d11db393",
      "mediaType": "ocm.software/vnd.ocm.software.component-descriptor",
      "size": 171
    },
    {
      "digest": "sha256:f60f3adf813135175cc0f45117e992c079c97795569721a09a5a9901c31affc0",
      "mediaType": "application/octet-stream",
      "size": 233
    }
  ]
}
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

No branches or pull requests

1 participant