Skip to content

feat: add layer and image size information to describe command - #760

Merged
devacts merged 5 commits into
carvel-dev:developfrom
mdzhigarov:add-layer-size
Nov 3, 2025
Merged

devacts merged 5 commits into
carvel-dev:developfrom
mdzhigarov:add-layer-size

Conversation

@mdzhigarov

Copy link
Copy Markdown
Contributor

Summary

This PR enhances the imgpkg describe command to include size information for both individual layers and total image sizes when using the --layers flag.

Changes

  • Add Size field to Layers struct to track individual layer sizes
  • Add Size field to ImageInfo struct to track total image size
  • Modify getImageLayersInfo function to calculate and return both layer sizes and total image size
  • Update text output format to display image size information
  • Maintain backward compatibility with existing functionality

Testing

  • All existing tests pass
  • Code compiles successfully
  • No breaking changes to existing functionality

Example Output

When using imgpkg describe -b <bundle> --layers, users will now see:

- Image: example.com/app@sha256:abc123
  Type: ContentImage
  Size: 1234567 bytes
  Layers:
    - Digest: sha256:def456
      Size: 500000
    - Digest: sha256:ghi789  
      Size: 734567

- Add Size field to Layers struct to track individual layer sizes
- Add Size field to ImageInfo struct to track total image size
- Modify getImageLayersInfo function to calculate and return both layer sizes and total image size
- Update text output format to display image size information
- Maintain backward compatibility with existing functionality

This enhancement provides users with detailed size information for both
individual layers and total image sizes when using the describe command
with the --layers flag.

Signed-off-by: Marin Dzhigarov <m.dzhigarov@gmail.com>
Signed-off-by: Marin Dzhigarov <m.dzhigarov@gmail.com>
Signed-off-by: Marin Dzhigarov <m.dzhigarov@gmail.com>
@joaopapereira

Copy link
Copy Markdown
Member

Can you please revise develop?

@mdzhigarov

Copy link
Copy Markdown
Contributor Author

Can you please revise develop?

Done

@devacts

devacts commented Nov 3, 2025

Copy link
Copy Markdown
Contributor

@mdzhigarov @joaopapereira
ghcr tests are failing due to PAT not being accessible for users in a fork PR.
Ran the test via workflow_dispatch and it passed
https://github.com/carvel-dev/imgpkg/actions/runs/19024299188/job/54325107254

created a PR #761 to run ghcr external tests based on PAT user configured to access ghcr registry packages and workflows

@devacts devacts left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

LGTM

@devacts

devacts commented Nov 3, 2025

Copy link
Copy Markdown
Contributor

merging the PR as env secrets are not accessible to fork users. The test has succeeded earlier using workflow_dispatch.
Will make this test run only on push in future
cc @joaopapereira @mdzhigarov

@devacts
devacts merged commit bc1694b into carvel-dev:develop Nov 3, 2025
2 checks passed
@github-project-automation github-project-automation Bot moved this to Closed in Carvel Nov 3, 2025

This branch had an error being deployed

2 failed (1 outdated) deployments
GHCR e2e — ad8b0b3e Deployed Nov 3, 2025 by mdzhigarov
GCR e2e — e92ceda5 Deployed Oct 30, 2025 by mdzhigarov
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Archived in project

Development

Successfully merging this pull request may close these issues.

3 participants