distribution-tooling-for-helm icon indicating copy to clipboard operation
distribution-tooling-for-helm copied to clipboard

Update dependency repository when relocating

Open PhilKershaw opened this issue 1 year ago • 4 comments

Is your feature request related to a problem? Please describe.

When relocating a Helm Chart with one of more dependencies the repository for said dependencies is not updated to the new location in the parent Chart.yaml. Meaning when installing the newly relocated parent chart it still pulls the original dependencies that contain the original image references.

Describe the solution you'd like

When relocating/unwrapping to a new repository the dependency repository references in Chart.yaml are updated to the new location. Thus, referencing the relocated subcharts that have references to the relocated images.

Describe alternatives you've considered

Besides manual intervention, no other alternatives considered.

Additional context

No response

PhilKershaw avatar Apr 22 '24 18:04 PhilKershaw

Hi @PhilKershaw

The references to the sub-charts into the Chart.yaml are used mainly for 'pacakging' a new Helm chart. The scenario that Helm dt took into account is to have all the dependant Helm charts inside the "charts/" folder inside the main one.

When installing the main chart, the the dependant charts installed comes from the local directory "charts/" that have been modified to use the proper registry.

Are you bundling the Helm charts with the 'helm pack' command before running the 'helm dt' tool?

beltran-rubo avatar Apr 25 '24 10:04 beltran-rubo

Hi @beltran-rubo

Thanks for sharing the thinking behind the approach. I totally understand and in practice it mostly works out.

Would there be any value in enabling an option to relocate dependency Helm Charts separately and not expecting them to be bundled? This would reduce duplication on the target registry side and possibly other benefits that don’t occur to me right now.

To your question RE running helm pack before dt. As part of a relocation procedure I run helm dep build which pulls the archive files before running helm dt wrap which would pulls down the images. There is a slight issue with this flow in that I have to extract the archives before helm dt wrap will run. It’s not a big issue but could perhaps be a little cleaner.

PhilKershaw avatar Apr 28 '24 21:04 PhilKershaw

helm dt relies on the immutability of the images & dependencies so it is able to redistribute and verify the copy was done properly. In that case it requires the subcharts are already part of the chart (and part of the Chart.lock file).

beltran-rubo avatar Apr 29 '24 09:04 beltran-rubo

It appears that this does not work if there are multiple layers of dependencies, e.g., chartA depends on chartB depends on chartC - chartC does not get relocated

shortwavedave avatar Jun 16 '24 14:06 shortwavedave