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

Unexpected output for 'zarf package inspect --list-images' #3374

Closed
philiversen opened this issue Jan 6, 2025 · 1 comment · Fixed by #3384
Closed

Unexpected output for 'zarf package inspect --list-images' #3374

philiversen opened this issue Jan 6, 2025 · 1 comment · Fixed by #3384

Comments

@philiversen
Copy link

Environment

Device and OS: Ubuntu Linux
App version: 0.45.0
Kubernetes distro being used: N/A
Other:

Steps to reproduce

  1. Get a zarf package i.e. zarf package pull oci://ghcr.io/defenseunicorns/packages/dos-games:1.0.0
  2. Inspect the package with the --list-images option

Expected result

Expect the --list-images option to limit output to the list of images from all components. i.e.

zarf package inspect zarf-package-dos-games-amd64-1.0.0.tar.zst --skip-signature-validation --list-images

 NOTE  Saving log file to /tmp/zarf-2025-01-06-12-09-11-3850827383.log
- defenseunicorns/zarf-game:multi-tile-dark

Actual Result

Output lists the images as expected, but also includes the full package inspect output. In earlier Zarf versions (0.43.1), the full package information went to stderr similar to the note regarding the log location which made it easy to ignore. Now both the image list and the full inspect output both go to stdout.

zarf package inspect zarf-package-dos-games-amd64-1.0.0.tar.zst --skip-signature-validation --list-images

 NOTE  Saving log file to /tmp/zarf-2025-01-06-12-09-11-3850827383.log
- defenseunicorns/zarf-game:multi-tile-dark

kind: ZarfPackageConfig
metadata:
  name: dos-games
  description: Simple example to load classic DOS games into K8s in the airgap
  version: 1.0.0
  architecture: amd64
  aggregateChecksum: 041ec31370faf9b8989bba322244015c7a3cebcfb6f79b0d7ccf4e3ac2e07510
build:
  terminal: fv-az1393-110
  user: runner
  architecture: amd64
  timestamp: Wed, 03 Jan 2024 05:05:14 +0000
  version: v0.32.0
  migrations:
  - scripts-to-actions
  - pluralize-set-variable
  lastNonBreakingVersion: v0.27.0
components:
- name: baseline
  required: true
  manifests:
  - name: multi-games
    namespace: dos-games
    files:
    - manifests/deployment.yaml
    - manifests/service.yaml
  images:
  - defenseunicorns/zarf-game:multi-tile-dark
  actions:
    onDeploy:
      after:
      - wait:
          cluster:
            kind: deployment
            name: game
            namespace: dos-games
            condition: available

Visual Proof (screenshots, videos, text, etc)

image

Severity/Priority

Very low - minor inconvenience. Desired information can be parsed from the full inspect output i.e.

zarf package inspect --no-color --skip-signature-validation zarf-package-dos-games-amd64-1.0.0.tar.zst 2>/dev/null | zarf tools yq -o yaml '[.components[].images[]]'
- defenseunicorns/zarf-game:multi-tile-dark

Additional Context

None.

@AustinAbro321
Copy link
Contributor

Yeah this is a bug. Looks like at some point zarf package inspect --list-images was changed to both list images and print out the yaml whereas it used to be one or the other.

We also changed yaml printing to go to stdout in v0.44.0, but as long as the same command doesn't print both it shouldn't be an issue. Thanks for reporting!

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

Successfully merging a pull request may close this issue.

2 participants