Skip to content

Conversation

@mdzhigarov
Copy link
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
Member

Can you please revise develop?

@mdzhigarov
Copy link
Contributor Author

Can you please revise develop?

Done

@devanshuVmware
Copy link
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

Copy link
Contributor

@devanshuVmware devanshuVmware left a comment

Choose a reason for hiding this comment

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

LGTM

@devanshuVmware
Copy link
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

@devanshuVmware devanshuVmware merged commit bc1694b into carvel-dev:develop Nov 3, 2025
7 of 9 checks passed
@github-project-automation github-project-automation bot moved this to Closed in Carvel Nov 3, 2025
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