vmware-labs / distribution-tooling-for-helm

Helm Distribution plugin is is a set of utilities and Helm Plugin for making offline work with Helm Charts easier. It is meant to be used for creating reproducible and relocatable packages for Helm Charts that can be moved around registries without hassles. This is particularly useful for distributing Helm Charts into airgapped environments.
Apache License 2.0
65 stars 10 forks source link

Invalid path when searching Images.lock #70

Open BLaurent opened 2 weeks ago

BLaurent commented 2 weeks ago

Describe the bug

I am creating wrap.tgz package and just want to get some info about it:

helm dt info simple-web-api-0.7.5.wrap.tgz
failed to load Images.lock: Images.lock not found in wrap
Error: plugin "dt" exited with error

Plugin info:

helm dt version
Distribution Tooling for Helm v0.4.1
Built on: 2024-04-04T15:45:20Z

OS info:

OS: macOS 14.4 23E214 arm64

Reproduction steps

  1. Create a wrap file helm dt wrap ./path_to_helm_chart
  2. Execute helm dt info ./path_to_wrap.tgz

Expected behavior

When I do tar tvfz simple-web-api-0.7.5.wrap.tgz I have this output :

  simple-web-api-0.7.5/chart
  simple-web-api-0.7.5/chart/.helmignore
  simple-web-api-0.7.5/chart/.imgpkg
  simple-web-api-0.7.5/chart/.imgpkg/bundle.yml
  simple-web-api-0.7.5/chart/.imgpkg/images.yml
  simple-web-api-0.7.5/chart/Chart.lock
  simple-web-api-0.7.5/chart/Chart.yaml
  simple-web-api-0.7.5/chart/Chart_template.yaml
  simple-web-api-0.7.5/chart/Images.lock
  simple-web-api-0.7.5/chart/README.md
  simple-web-api-0.7.5/chart/charts

Images.lock is in a sub-directory named chart due to

But in this StripComponents is set to 1. The Images.lock cannot be found as the method here will return chart/Images.lock and the test is done with Images.lock

Additional context

No response

alemorcuq commented 2 weeks ago

Thanks for reporting. We will work on a fix.

BLaurent commented 3 days ago

If I may, there is smth, I do not understand. The dt info command is documented to work on wrapped chart as shown in the readme. However it does work when passing a chart directory. Handy it is for sure but all the tests are built around assumption the chart directory is rendered at the root of the temp directory.

BLaurent commented 3 days ago

I've proposed this PR #75