Skip to content

Beautify release-info; add markdown option; remove yaml/json options#407

Open
dharmit wants to merge 2 commits intoSUSE:mainfrom
dharmit:release-info-redo
Open

Beautify release-info; add markdown option; remove yaml/json options#407
dharmit wants to merge 2 commits intoSUSE:mainfrom
dharmit:release-info-redo

Conversation

@dharmit
Copy link
Copy Markdown
Contributor

@dharmit dharmit commented Apr 2, 2026

The release-info command is for users who want to quickly understand
what's in a manifest file without having to go through the pain of
reading a YAML file. As such, they shouldn't need json/yaml outputs, so
removed them. One can always open the manifest file and "read" the yaml
if they want to.

Markdown support makes it more accessible to be viewed even in a
browser, e.g., open file.md in a browser:

$ elemental3 release-info -m file.yaml > file.md

Examples

Core manifest file

manifest.yaml
metadata:
  name: suse-core-test
  version: 0.6-rc.20260317
  creationDate: '2026-03-17'
components:
  operatingSystem:
    image:
      base: registry.suse.com/beta/uc/uc-base-os-kernel-default:16.0-55.79
      iso: registry.suse.com/beta/uc/uc-base-kernel-default-iso:16.0-55.132
  kubernetes:
    version: v1.35.0+rke2r1
    image: registry.suse.com/beta/uc/rke2:1.35_1.42-1.77
  systemd:
    extensions:
    - name: elemental3ctl
      image: registry.suse.com/beta/uc/elemental3ctl:0.6_19.2-3.151
      required: true
  helm:
    charts:
    - name: MetalLB
      chart: metallb
      version: 0.15.2
      namespace: metallb-system
      repository: metallb
    - name: Endpoint Copier Operator
      chart: endpoint-copier-operator
      version: 0.3.0
      namespace: endpoint-copier-operator
      repository: suse-edge
    repositories:
    - name: metallb
      url: https://metallb.github.io/metallb
    - name: suse-edge
      url: https://suse-edge.github.io/charts
elemental3 release-info --local manifest.yaml
$ sudo ./build/elemental3 release-info --local ~/release_manifest_2.yaml
┌──────────────┬──────────────────────────────────────────────┐
│  ATTRIBUTE   │           CORE PLATFORM  ( BASE )            │
├──────────────┼──────────────────────────────────────────────┤
│ Name         │ suse-core-test                               │
│ Version      │ 0.6-rc.20260317                              │
│ Release Data │ 2026-03-17                                   │
│ Source       │ file:///home/dharmit/release_manifest_2.yaml │
└──────────────┴──────────────────────────────────────────────┘

┌───────────────────────────┬────────────────┬────────────────────────────────────────────────────────────────┐
│ INFRASTRUCTURE COMPONENTS │    VERSION     │                             SOURCE                             │
├───────────────────────────┼────────────────┼────────────────────────────────────────────────────────────────┤
│ Operating System          │ SLES 16.0      │ registry.suse.com/beta/uc/uc-base-os-kernel-default:16.0-55.79 │
│ Kubernetes                │ v1.35.0+rke2r1 │ registry.suse.com/beta/uc/rke2:1.35_1.42-1.77                  │
└───────────────────────────┴────────────────┴────────────────────────────────────────────────────────────────┘

┌────────────────────┬────────────────────────────────────────────────────────┐
│ SYSTEMD EXTENSIONS │                    IMAGE REFERENCE                     │
├────────────────────┼────────────────────────────────────────────────────────┤
│ elemental3ctl      │ registry.suse.com/beta/uc/elemental3ctl:0.6_19.2-3.151 │
└────────────────────┴────────────────────────────────────────────────────────┘

┌──────────────────────────┬─────────┬────────────────────────────────────┬──────────────────────────┬────────────┐
│        CHART NAME        │ VERSION │             REPOSITORY             │     TARGET NAMESPACE     │ DEPENDS ON │
├──────────────────────────┼─────────┼────────────────────────────────────┼──────────────────────────┼────────────┤
│ metallb                  │ 0.15.2  │ https://metallb.github.io/metallb  │ metallb-system           │ -          │
│ endpoint-copier-operator │ 0.3.0   │ https://suse-edge.github.io/charts │ endpoint-copier-operator │ -          │
└──────────────────────────┴─────────┴────────────────────────────────────┴──────────────────────────┴────────────┘
Markdown output
$ sudo ./build/elemental3 release-info --local -m ~/release_manifest_2.yaml
|  ATTRIBUTE   |           CORE PLATFORM  ( BASE )            |
|:------------:|:--------------------------------------------:|
|     Name     |                suse-core-test                |
|   Version    |               0.6-rc.20260317                |
| Release Data |                  2026-03-17                  |
|    Source    | file:///home/dharmit/release_manifest_2.yaml |

| INFRASTRUCTURE COMPONENTS |    VERSION     |                             SOURCE                             |
|:-------------------------:|:--------------:|:--------------------------------------------------------------:|
|     Operating System      |   SLES 16.0    | registry.suse.com/beta/uc/uc-base-os-kernel-default:16.0-55.79 |
|        Kubernetes         | v1.35.0+rke2r1 |         registry.suse.com/beta/uc/rke2:1.35_1.42-1.77          |

| SYSTEMD EXTENSIONS |                    IMAGE REFERENCE                     |
|:------------------:|:------------------------------------------------------:|
|   elemental3ctl    | registry.suse.com/beta/uc/elemental3ctl:0.6_19.2-3.151 |

|        CHART NAME        | VERSION |             REPOSITORY             |     TARGET NAMESPACE     | DEPENDS ON |
|:------------------------:|:-------:|:----------------------------------:|:------------------------:|:----------:|
|         metallb          | 0.15.2  | https://metallb.github.io/metallb  |      metallb-system      |     -      |
| endpoint-copier-operator |  0.3.0  | https://suse-edge.github.io/charts | endpoint-copier-operator |     -      |

Product Manifest file

manifest.yaml
metadata:
  name: "suse-product"
  version: "4.2.0"
  creationDate: "2025-12-08"
corePlatform:
  # Registry path to the release manifest OCI image of the Core Platform that this SUSE Product extends
  image: "registry.suse.com/beta/uc/release-manifest:0.6_rke2_1.35"
components:
  systemd:
    extensions:
      - name: "longhorn"
        image: "registry.suse.com/beta/uc/longhorn:5.36-1.88"
  helm:
    charts:
      - chart: "cert-manager"
        version: "v1.17.2"
        namespace: "cert-manager"
        repository: "jetstack"
        values:
          crds:
            enabled: true
      - chart: "rancher"
        version: "2.13.0"
        namespace: "cattle-system"
        repository: "rancher"
        values:
          replicas: 1
        dependsOn:
          - name: "cert-manager"
            type: "helm"
      - chart: "longhorn-crd"
        version: "107.0.0+up1.9.1"
        namespace: "longhorn-system"
        repository: "rancher-charts"
      - chart: "longhorn"
        version: "107.0.0+up1.9.1"
        namespace: "longhorn-system"
        repository: "rancher-charts"
        dependsOn:
          - name: "longhorn-crd"
            type: "helm"
          - name: "longhorn"
            type: "sysext"
    repositories:
      - name: "jetstack"
        url: "https://charts.jetstack.io"
      - name: "rancher"
        url: "https://releases.rancher.com/server-charts/stable"
      - name: "rancher-charts"
        url: "https://charts.rancher.io"
elemental3 release-info --local manifest.yaml
$ sudo ./build/elemental3 release-info --local examples/elemental/customize/multi-node/suse-product-manifest.yaml
⠋ Extracting (2.6 kB, 1.2 MB/s) [0s]
┌──────────────┬──────────────────────────────────────────────────────────┬───────────────────────────────────────────────────────────────────────────┐
│  ATTRIBUTE   │                 CORE PLATFORM  ( BASE )                  │                      PRODUCT MANIFEST  ( EXTENSION )                      │
├──────────────┼──────────────────────────────────────────────────────────┼───────────────────────────────────────────────────────────────────────────┤
│ Name         │ suse-core                                                │ suse-product                                                              │
│ Version      │ 0.6-rc.20260329                                          │ 4.2.0                                                                     │
│ Release Date │ 2026-03-29                                               │ 2025-12-08                                                                │
│ Source       │ registry.suse.com/beta/uc/release-manifest:0.6_rke2_1.35 │ file://examples/elemental/customize/multi-node/suse-product-manifest.yaml │
└──────────────┴──────────────────────────────────────────────────────────┴───────────────────────────────────────────────────────────────────────────┘

┌───────────────────────────┬────────────────┬────────────────────────────────────────────────────────────────┐
│ INFRASTRUCTURE COMPONENTS │    VERSION     │                             SOURCE                             │
├───────────────────────────┼────────────────┼────────────────────────────────────────────────────────────────┤
│ Operating System          │ SLES 16.0      │ registry.suse.com/beta/uc/uc-base-os-kernel-default:16.0-58.30 │
│ Kubernetes                │ v1.35.1+rke2r1 │ registry.suse.com/beta/uc/rke2-tar:1.35.1_rke2r1-2.1           │
└───────────────────────────┴────────────────┴────────────────────────────────────────────────────────────────┘

┌────────────────────┬───────────────────────────────────────────────────────┐
│ SYSTEMD EXTENSIONS │                    IMAGE REFERENCE                    │
├────────────────────┼───────────────────────────────────────────────────────┤
│ elemental3ctl      │ registry.suse.com/beta/uc/elemental3ctl:0.6_23.2-4.32 │
│ longhorn(*)        │ registry.suse.com/beta/uc/longhorn:5.36-1.88          │
└────────────────────┴───────────────────────────────────────────────────────┘

┌──────────────────────────┬─────────────────┬───────────────────────────────────────────────────┬──────────────────────────┬─────────────────────┐
│        CHART NAME        │     VERSION     │                    REPOSITORY                     │     TARGET NAMESPACE     │     DEPENDS ON      │
├──────────────────────────┼─────────────────┼───────────────────────────────────────────────────┼──────────────────────────┼─────────────────────┤
│ metallb                  │ 0.15.2          │ https://metallb.github.io/metallb                 │ metallb-system           │ -                   │
│ endpoint-copier-operator │ 0.3.0           │ https://suse-edge.github.io/charts                │ endpoint-copier-operator │ -                   │
│ cert-manager(*)          │ v1.17.2         │ https://charts.jetstack.io                        │ cert-manager             │ -                   │
│ rancher(*)               │ 2.13.0          │ https://releases.rancher.com/server-charts/stable │ cattle-system            │ cert-manager (helm) │
│ longhorn-crd(*)          │ 107.0.0+up1.9.1 │ https://charts.rancher.io                         │ longhorn-system          │ -                   │
│ longhorn(*)              │ 107.0.0+up1.9.1 │ https://charts.rancher.io                         │ longhorn-system          │ longhorn-crd (helm) │
│                          │                 │                                                   │                          │ longhorn (sysext)   │
└──────────────────────────┴─────────────────┴───────────────────────────────────────────────────┴──────────────────────────┴─────────────────────┘
Markdown output
$ sudo ./build/elemental3 release-info --local -m examples/elemental/customize/multi-node/suse-product-manifest.yaml
⠋ Extracting (2.6 kB, 1.4 MB/s) [0s]
|  ATTRIBUTE   |                 CORE PLATFORM  ( BASE )                  |                      PRODUCT MANIFEST  ( EXTENSION )                      |
|:------------:|:--------------------------------------------------------:|:-------------------------------------------------------------------------:|
|     Name     |                        suse-core                         |                               suse-product                                |
|   Version    |                     0.6-rc.20260329                      |                                   4.2.0                                   |
| Release Date |                        2026-03-29                        |                                2025-12-08                                 |
|    Source    | registry.suse.com/beta/uc/release-manifest:0.6_rke2_1.35 | file://examples/elemental/customize/multi-node/suse-product-manifest.yaml |

| INFRASTRUCTURE COMPONENTS |    VERSION     |                             SOURCE                             |
|:-------------------------:|:--------------:|:--------------------------------------------------------------:|
|     Operating System      |   SLES 16.0    | registry.suse.com/beta/uc/uc-base-os-kernel-default:16.0-58.30 |
|        Kubernetes         | v1.35.1+rke2r1 |      registry.suse.com/beta/uc/rke2-tar:1.35.1_rke2r1-2.1      |

| SYSTEMD EXTENSIONS |                    IMAGE REFERENCE                    |
|:------------------:|:-----------------------------------------------------:|
|   elemental3ctl    | registry.suse.com/beta/uc/elemental3ctl:0.6_23.2-4.32 |
|    longhorn(*)     |     registry.suse.com/beta/uc/longhorn:5.36-1.88      |

|        CHART NAME        |     VERSION     |                    REPOSITORY                     |     TARGET NAMESPACE     |     DEPENDS ON      |
|:------------------------:|:---------------:|:-------------------------------------------------:|:------------------------:|:-------------------:|
|         metallb          |     0.15.2      |         https://metallb.github.io/metallb         |      metallb-system      |          -          |
| endpoint-copier-operator |      0.3.0      |        https://suse-edge.github.io/charts         | endpoint-copier-operator |          -          |
|     cert-manager(*)      |     v1.17.2     |            https://charts.jetstack.io             |       cert-manager       |          -          |
|        rancher(*)        |     2.13.0      | https://releases.rancher.com/server-charts/stable |      cattle-system       | cert-manager (helm) |
|     longhorn-crd(*)      | 107.0.0+up1.9.1 |             https://charts.rancher.io             |     longhorn-system      |          -          |
|       longhorn(*)        | 107.0.0+up1.9.1 |             https://charts.rancher.io             |     longhorn-system      | longhorn-crd (helm) |
|                          |                 |                                                   |                          |  longhorn (sysext)  |

The release-info command is for users who want to quickly understand
what's in a manifest file without having to go through the pain of
reading a YAML file. As such, they shouldn't need json/yaml outputs, so
removed them. One can always open the manifest file and "read" the yaml
if they want to.

Markdown support makes it more accessible to be viewed even in a
browser, e.g., open file.md in a browser:

elemental3 release-info -m file.yaml > file.md
@dharmit dharmit requested a review from a team as a code owner April 2, 2026 07:53
Copy link
Copy Markdown
Contributor Author

@dharmit dharmit left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Couple of questions for the reviewer.

Comment on lines +93 to +96
out := cmd.Writer
if out == nil {
out = cmd.Root().Writer
}
Copy link
Copy Markdown
Contributor Author

@dharmit dharmit Apr 2, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This was done with AI's help. It helped get rid of GetOutput I added to the Logger interface the previous time.

PTAL if it makes sense or needs change.

if out == nil {
out = cmd.Root().Writer
}
return printManifest(resolved, uri, out)
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The out argument is passed around in a bunch of print* functions. If var markdown bool done at the top of this file makes sense, I can use the same pattern for out too. Is that worth it?

Copy link
Copy Markdown
Contributor

@atanasdinov atanasdinov left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks great! I'm only sceptic of the Product side column indication; it feels off. Perhaps we can have the "*" symbol right next to the component names and drop the column unless anything better comes to mind?

@dharmit dharmit force-pushed the release-info-redo branch from b84b510 to 9cf696c Compare April 7, 2026 06:48
@dharmit
Copy link
Copy Markdown
Contributor Author

dharmit commented Apr 7, 2026

Perhaps we can have the "*" symbol right next to the component names and drop the column unless anything better comes to mind?

Just a * wasn't clearly visible, so I went with (*) instead.

Copy link
Copy Markdown
Contributor

@atanasdinov atanasdinov left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please rebase before hitting the merge button once we get a second approval. Thanks!

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