Skip to content

fix: make sure that helm downloader does not overwrite chart with provenance data (#1481)#1485

Merged
jakobmoellerdev merged 1 commit into
open-component-model:releases/v0.23from
jakobmoellerdev:fixup-helm-download-prov-behavior-v0.23
May 23, 2025
Merged

fix: make sure that helm downloader does not overwrite chart with provenance data (#1481)#1485
jakobmoellerdev merged 1 commit into
open-component-model:releases/v0.23from
jakobmoellerdev:fixup-helm-download-prov-behavior-v0.23

Conversation

@jakobmoellerdev
Copy link
Copy Markdown
Member

What this PR does / why we need it

in the helm downloader, there was a case when the chart data was overwritten with the provenance data. if the target path passed to the downloader was a path such as path.tgz then this path was reused for writing the provenance file.

This was now fixed and there will be:

  1. A download path pointing to the .tgz => chart.tgz
  2. A provenance file (if it exists) => chart.prov

Which issue(s) this PR fixes

Note that before, due to buggy behavior the output provenance file was just called chart because the .prov file extension was not properly added. this has been fixed as well.

additionally if the file path was tar.gz instead of tgz, the file ending removal was incorrect. this has been fixed.

This was also the last reason why the ocm download resource command returned incorrect data in the tgz when downloading a resource with accessType helm.

fix #1469

(cherry picked from commit c2e1bd2)

…venance data (open-component-model#1481)

<!-- markdownlint-disable MD041 -->
#### What this PR does / why we need it

in the helm downloader, there was a case when the chart data was
overwritten with the provenance data. if the target path passed to the
downloader was a path such as `path.tgz` then this path was reused for
writing the provenance file.

This was now fixed and there will be:

1. A download path pointing to the .tgz => chart.tgz
2. A provenance file (if it exists) => chart.prov

#### Which issue(s) this PR fixes
<!--
Usage: `Fixes #<issue number>`, or `Fixes (paste link of issue)`.
-->

Note that before, due to buggy behavior the output provenance file was
just called `chart` because the .prov file extension was not properly
added. this has been fixed as well.

additionally if the file path was `tar.gz` instead of `tgz`, the file
ending removal was incorrect. this has been fixed.

This was also the last reason why the ocm download resource command
returned incorrect data in the tgz when downloading a resource with
accessType helm.

fix open-component-model#1469

(cherry picked from commit c2e1bd2)
@jakobmoellerdev jakobmoellerdev requested a review from a team as a code owner May 23, 2025 12:49
@jakobmoellerdev jakobmoellerdev merged commit 781b099 into open-component-model:releases/v0.23 May 23, 2025
19 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants