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

ci(helm): no duplicates in helm chart package #6512

Merged
merged 5 commits into from
Apr 12, 2023

Conversation

bartsmykla
Copy link
Contributor

@bartsmykla bartsmykla commented Apr 12, 2023

Chart Releaser is always packaging dependencies specified in Chart.yaml file first. The archives with packaged dependencies lands inside "charts" directory (i.e. deployments/[...]/charts/[dependency_name]-[version].tgz). When building the final chart package, it includes inside, the content of the "charts" directory. When it finds an archive there, it flattens it and includes in the final package as well. It means if the chart have any dependencies, the final chart's archive will contain duplicated manifests. To mitigate this issue we are unarchiving (which would remove duplicates) and archiving the chart again.

Checklist prior to review

  • Link to relevant issue as well as docs and UI issues --
  • This will not break child repos: it doesn't hardcode values (.e.g "kumahq" as a image registry) and it will work on Windows, system specific functions like syscall.Mkfifo have equivalent implementation on the other OS --
  • Tests (Unit test, E2E tests, manual test on universal and k8s) --
  • Do you need to update UPGRADE.md? --
  • Does it need to be backported according to the backporting policy? --
  • Do you need to explicitly set a > Changelog: entry here or add a ci/ label to run fewer/more tests?

Changelog: Modify helm.sh script to make sure no duplicate manifests will be present in packaged chart

Chart Releaser is always packaging dependencies specified in Chart.yaml
file first. The archives with packaged dependencies lands inside "charts"
directory (i.e. deployments/[...]/charts/[dependency_name]-[version].tgz).
When building the final chart package, it includes inside, the content of
the "charts" directory. When it finds an archive there, it flattens it and
includes in the final package as well. It means if the chart have any
dependencies, the final chart's archive will contain duplicated manifests.
As Chart Releaser will automatically download the dependencies and then
will archive them, we can safely remove the content of "charts" directory
to mitigate the above issue.

Signed-off-by: Bart Smykla <[email protected]>
@bartsmykla bartsmykla requested review from a team, michaelbeaumont and slonka and removed request for a team April 12, 2023 06:23
slonka
slonka previously approved these changes Apr 12, 2023
Copy link
Contributor

@slonka slonka left a comment

Choose a reason for hiding this comment

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

Same comment as the master branch one

@lahabana
Copy link
Contributor

Should we get rid of the explicit dependency and only rely on side packaged child helm chart. It seems like this double dependency is just recurring issues and troubles.

@slonka slonka dismissed their stale review April 12, 2023 10:13

seems like I'm not an expert in this, I'll let other people review this

@slonka slonka requested a review from lahabana April 12, 2023 10:13
@bartsmykla bartsmykla merged commit 6a33b60 into release-2.2 Apr 12, 2023
@bartsmykla bartsmykla deleted the ci/no-duplicates-in-helm-chart-package branch April 12, 2023 10:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants