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

chore: raw manifest indentation #2056

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

GabriFedi97
Copy link

Description

Add indentation to raw manifests to improve readability.

Example

Following the example in the issue #2055, mutating the manifest after this patch will produce a new manifest with indentation:

  1. Inspect the manifest with crane manifest:
crane manifest localhost:5000/simple-manifest:latest

{
  "schemaVersion": 2,
  "mediaType": "application/vnd.docker.distribution.manifest.v2+json",
  "config": {
    "mediaType": "application/vnd.docker.container.image.v1+json",
    "size": 897,
    "digest": "sha256:701db07f8f291e50fbb06b4dd13310acad36c53120adbdf2568bd2009d48a2a3"
  },
  "layers": null
}
  1. Mutate the manifest with crane mutate:
crane mutate localhost:5000/simple-manifest:latest

2025/02/08 13:04:41 existing blob: sha256:701db07f8f291e50fbb06b4dd13310acad36c53120adbdf2568bd2009d48a2a3
2025/02/08 13:04:41 localhost:5000/simple-manifest:latest: digest: sha256:e265ee69944da7c7dc2c32a18f11d2140333371a3fda5478a4900de543dacb45 size: 304
localhost:5000/simple-manifest@sha256:e265ee69944da7c7dc2c32a18f11d2140333371a3fda5478a4900de543dacb45
  1. Inspect the manifest again with crane manifest:
crane manifest localhost:5000/simple-manifest:latest
{
  "schemaVersion": 2,
  "mediaType": "application/vnd.docker.distribution.manifest.v2+json",
  "config": {
    "mediaType": "application/vnd.docker.container.image.v1+json",
    "size": 897,
    "digest": "sha256:701db07f8f291e50fbb06b4dd13310acad36c53120adbdf2568bd2009d48a2a3"
  },
  "layers": null
}

Closes #2055

Add indentation to raw manifests
to improve readability once uploaded
to the container registry.

Signed-off-by: Gabriele Fedi <[email protected]>
Signed-off-by: Gabriele Fedi <[email protected]>
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.

Enhancement: Add indentation to raw manifests
1 participant