Skip to content

chore: raw manifest indentation#2056

Open
GabriFedi97 wants to merge 2 commits intogoogle:mainfrom
GabriFedi97:indent-manifest
Open

chore: raw manifest indentation#2056
GabriFedi97 wants to merge 2 commits intogoogle:mainfrom
GabriFedi97:indent-manifest

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 <gabriele.fedi@enterprisedb.com>
Signed-off-by: Gabriele Fedi <gabriele.fedi@enterprisedb.com>
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