Skip to content

Promote the "--template" flag from Experimental to Preview #1812

Closed as not planned

Description

@FeynmanZhou

This issue is related to the proposal of promoting maturity of experimental and preview feature commands and flags #1771

The --template flag was introduced to several ORAS commands oras push/oras pull/oras attach/oras discover/oras manifest fetch in v1.2.0 as articulated in the spec, along with --format. It is currently marked as Experimental.

Rationale for Promotion

Over recent releases, the flag --template has demonstrated:

  • Functionality completeness – The feature has been used in the core use cases of defining Go template string used to format output
  • Stability – syntax and output structure have remained consistent over multiple releases.
  • Low maintenance overhead – No major breaking changes or regressions reported in recent cycles.

Given its maturity and stability, promoting --format to Preview will encourage broader adoption while signaling to users that the feature is nearing full stabilization.

Next Steps

  • Update the feature mark from Experimental to Preview in CLI documentation and help text.
  • Communicate the change in release notes for ORAS v1.3.0.
  • Continue gathering usage feedback and monitoring for edge cases in preparation for eventual promotion to Stable.

If you agree with this proposal, please vote on this issue with your comments. Thanks

Activity

  1. shizhMSFT commented on Aug 15, 2025

    @shizhMSFT
    Contributor

    Since the internal model of template is the same as --format json, I'd suggest keeping experimental and be consistent with #1808.

  2. added this to the v1.4.0 milestone on Aug 20, 2025
  3. ggjulio commented on Dec 17, 2025

    @ggjulio

    Not sure what I'm doing wrong but, I was trying to get the value of some fields in a manifest.

    manifest example
    {
      "schemaVersion": 2,
      "mediaType": "application/vnd.oci.image.manifest.v1+json",
      "config": {
        "mediaType": "application/vnd.cncf.helm.config.v1+json",
        "digest": "sha256:eaea14941b04bcdb0595c359a31f8dab61f137299c9fa5410c74d2408cda1789",
        "size": 220
      },
      "layers": [
        {
          "mediaType": "application/vnd.cncf.helm.chart.content.v1.tar+gzip",
          "digest": "sha256:0090c532386f29b8436c34eb56055e922f2d0fd6adda1b83fc924717b1ae994f",
          "size": 45915,
          "annotations": {
            "org.opencontainers.image.title": "target/dh-7.5.0-0-SNAPSHOT.tgz"
          }
        }
      ],
      "annotations": {
        "org.opencontainers.image.authors": "redacted,
        "org.opencontainers.image.created": "2025-12-17T09:20:56Z",
        "org.opencontainers.image.description": "redacted",
        "org.opencontainers.image.revision": "e12fb7954a7e8cbfa61b4fd740fd70519f137cbb",
        "org.opencontainers.image.title": "redacted",
        "org.opencontainers.image.vendor": "redacted",
        "org.opencontainers.image.version": "0.1.0"
      }
    }
    

    This one works:

    • oras manifest fetch --format go-template --template='{{index .mediaType }}' $OCI_REF

    Theses one don't

    • oras manifest fetch --format go-template --template='{{ .config.mediaType }}' $OCI_REF
    • oras manifest fetch --format go-template --template='{{ index .config.mediaType }}' $OCI_REF
    • oras manifest fetch --format go-template --template='{{ index .annotations "org.opencontainers.image.revision"}}' $OCI_REF

    Log output example:

    $> oras manifest fetch --format go-template --template='{{ index .annotations }}' $OCI_REF
    Error: template: format output:1:3: executing "format output" at <index .annotations>: error calling index: index of untyped ni
    

    Am I missing something or it's a bug ?

    Maybe related to this: #1276

  4. TerryHowe commented on Oct 22, 2026

    @TerryHowe
    Member

    Closing as not planned. --template shares the internal model with --format json, so it stays experimental alongside it (see #1808 and the discussion above).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions