Commit Graph

210 Commits

Author SHA1 Message Date
tison 4576a81a00
for remaining local variable case inconsistency
Signed-off-by: tison <wander4096@gmail.com>
2025-11-07 11:41:19 +08:00
tison 90d01915f9
for all other similar cases
Signed-off-by: tison <wander4096@gmail.com>
2025-11-04 11:33:42 +08:00
Matt Farina 52267ee74b Move repo package to versioned directory
The repo package is internally versioned at v1. Repos were designed
to be versioned. This change moves it to a versioned directory the
same way other packages are now being handled.

Signed-off-by: Matt Farina <matt.farina@suse.com>
2025-09-02 10:19:48 -04:00
Scott Rigby e814ff3c38
Remove unnecessary file i/o operations from signing and verifying
Signed-off-by: Scott Rigby <scott@r6by.com>
2025-08-30 17:28:16 -05:00
Matt Farina fea6d8eb04
Updating to tested content cache
A few things are added here:
1. The cache is made to be more generic as a content based cache.
   It could be used for other things such as plugins
2. Flags were added to specify the content cache locaiton rather
   than rely on the repository cache. Keeping the 2 the same
   hid bugs and errors.
3. Tests were added and updated to ensure the cache is used and
   tested

Signed-off-by: Matt Farina <matt.farina@suse.com>
2025-08-21 14:33:51 -04:00
Matt Farina 6ac2c34689
Initial addition of content based cache
The previous cache was based on chart name and version. If 2 charts
with different content had the same name and version they would collide.
Helm did not trust the cache because of this and always downloaded
content. It was a short lived cache.

This commit introduces a content based cache which is based on the
content rather than file name. Charts with the same name but different
content are no longer an issue.

While the system assumes a file based interface, the cache system
is pluggable. In the future, it should return bytes for the content
instead of paths to it. That would requie a larger change for Helm 5
or later.

Signed-off-by: Matt Farina <matt.farina@suse.com>
2025-08-19 14:00:36 -04:00
Carlos Sanchez 4e483d36bd fix: prevent panic when ChartDownloader.getOciURI
needs to lookup tags because no version is provided
but no RegistryClient is provided

Signed-off-by: Carlos Sanchez <carlos@apache.org>
2025-08-04 21:38:42 +02:00
Matt Farina 76fdba4c8c
Updating link handling
Signed-off-by: Matt Farina <matt.farina@suse.com>
2025-07-07 10:09:25 -04:00
Benoit Tigeot 6df8eb3b3b
Fix flaky TestFindChartURL due to non-deterministic map iteration
The test was failing intermittently because Go's map iteration order
is randomized (see `range repos` in `findChartUrl`).
When looking up the `baz` chart with repository URL http://example.com/helm,
two repositories match due to trailing slash equivalence:

- testing-relative (URL: http://example.com/helm) - contains baz chart GOOD
- testing-relative-trailing-slash (URL: http://example.com/helm/) - does not contain baz chart.. NOT GOOD

The urlutil.Equal() function treats these URLs as equivalent, but
depending on which repository the random map iterator encounters
first, the test would either pass or fail with "entry not found".

So I changed the third test case from baz to foo chart, since foo exists
in both matching repositories. This eliminates the race condition while
preserving all test expectations and logic.

`findChartURL()` iterates over a map without deterministic
ordering, causing the first-match-wins behavior to be non-deterministic
when multiple repositories match the same URL pattern.

Signed-off-by: Benoit Tigeot <benoit.tigeot@lifen.fr>
2025-05-28 19:02:42 +02:00
Matt Farina f043faf0a3
Merge pull request #30862 from OmriSteiner/fix-absolute-uri
fix: correctly concat absolute URIs in repo cache
2025-05-20 15:38:49 +01:00
Matthieu MOREL 157f0ba10a chore: enable thelper
Signed-off-by: Matthieu MOREL <matthieu.morel35@gmail.com>
2025-05-16 10:25:08 +02:00
Omri Steiner c47c8fc868 fix: correctly concat absolute URIs in repo cache
There used to be two implemenations for concatenating the repo URL with
the chart URI / URL. In case the chart specified an absolute URI, one of
the implementations performed an incorrect concatenation between the
two, resulting in a URL which looks like <repo-URL><absolute-chart-URI>.

This commit removes the faulty implementation and uses the other correct
one instead.

Signed-off-by: Omri Steiner <omri@steiners.co.il>
2025-05-15 20:55:08 +02:00
Justen Stall 280a9ddbdb
Merge branch 'main' into stdlib-errors-2
Signed-off-by: Justen Stall <39888103+justenstall@users.noreply.github.com>
2025-04-21 12:13:10 -04:00
wangcundashang 7bb0c85441 chore: fix function name in comment
Signed-off-by: wangcundashang <wangcundashang@qq.com>
2025-04-18 19:11:41 +08:00
Matt Farina 61d3eca55c
Move pkg/chart to pkg/chart/v2 to prepare for v3 charts
This change moves the code, updates the import locations, and
adds a doc.go file to document what the v2 package is for.

This is part of HIP 20 for v3 charts

Signed-off-by: Matt Farina <matt.farina@suse.com>
2025-02-25 15:20:44 -05:00
Felipe Santos 392ff93916
Fix flaky TestDedupeRepos (#30576)
Signed-off-by: Felipe Santos <felipecassiors@gmail.com>
2025-02-23 11:51:33 -08:00
Joe Julian 0fcd1d33b3
Merge pull request #11112 from felipecrs/filter-dup-repos
perf(dep-up): do not update the same repo multiple times
2025-02-22 12:50:31 -08:00
Matt Farina 5c0deec327
Moving chartutil to chart/util
chartutil was originally created to operate on protobufs which are
no longer part of Helm. The util package makes more sense to be
part of the chart package.

This change is part of the HIP 20 to create v3 charts and
explicitly call out v2 charts. The changes for this are in smaller
bite size changes.

Signed-off-by: Matt Farina <matt.farina@suse.com>
2025-02-21 15:25:55 -05:00
Felipe Santos b1fd239167 Fix tests failing after removing repo normalization
Signed-off-by: Felipe Santos <felipecassiors@gmail.com>
2025-02-20 16:59:04 -03:00
Felipe Santos ecb5a2c9dd Fix variable name for linter
And restore trimSuffix instead of trimRight, which was a mistake.

Signed-off-by: Felipe Santos <felipecassiors@gmail.com>
2025-02-20 15:46:44 -03:00
Felipe Santos 281ccb0835 Do not store the normalized chart url
Signed-off-by: Felipe Santos <felipecassiors@gmail.com>
2025-02-20 15:33:52 -03:00
Felipe Santos bb6314adef Do not reassign repos variable
Signed-off-by: Felipe Santos <felipecassiors@gmail.com>
2025-02-20 14:45:43 -03:00
Felipe Santos 44d53e7d49 Merge branch 'main' of https://github.com/helm/helm into filter-dup-repos 2025-02-20 14:40:13 -03:00
Felipe Santos f692751a46 Merge branch 'main' of https://github.com/helm/helm into filter-dup-repos 2025-02-17 13:53:53 -03:00
George Jenkins 234d171da5 Cleanup repotest Server constructors
Signed-off-by: George Jenkins <gvjenkins@gmail.com>
2025-02-08 18:51:37 -08:00
George Jenkins 547f49abf6
Merge pull request #13579 from gjenkins8/rm_chart_repo_find_repo_dups
refactor: Remove duplicate `FindChartIn*RepoURL` functions
2025-02-05 13:21:35 -08:00
Terry Howe 5a7046b9bf chore(oci): upgrade to ORAS v2
Signed-off-by: Terry Howe <terrylhowe@gmail.com>
Co-authored-by: Zoran Regvart <zoran@regvart.com>
2025-02-02 07:28:41 -07:00
George Jenkins 0ce267d907 more options
Signed-off-by: George Jenkins <gvjenkins@gmail.com>
2025-01-24 20:44:45 -08:00
Matt Farina f65eaf35ce
Merge pull request #12690 from TerryHowe/oci-install-digest
feat: OCI install by digest
2025-01-01 17:49:14 +01:00
Matt Farina 2236294119 Updating to helm.sh/helm/v4
Since Helm is going through breaking changes with Helm v4, the version path to
Helm needs to be updated.

Signed-off-by: Matt Farina <matt.farina@suse.com>
2024-12-26 16:33:51 -05:00
Matt Farina 4dd2a7d626
Merge branch 'main' into oci-install-digest 2024-12-06 21:28:56 +01:00
Justen Stall 6aa19b8c92
more error wrapping uses
- replace os.IsNotExist with errors.Is and fs.ErrNotExist
- use %w directive

Signed-off-by: Justen Stall <39888103+justenstall@users.noreply.github.com>
2024-11-18 12:54:09 -05:00
Justen Stall 63cf42a843
fix: replace "github.com/pkg/errors" with stdlib "errors" package
Signed-off-by: Justen Stall <39888103+justenstall@users.noreply.github.com>
2024-11-18 11:35:59 -05:00
Robert Sirchia 5ae91e11ae
Merge pull request #13034 from mattclegg/issue-9507
ISSUE-9507: ADD `application/gzip,application/octet-stream` accept header
2024-10-25 16:10:20 -04:00
Terry Howe d2b94f6200 fix: make ORAS reference private
Signed-off-by: Terry Howe <terrylhowe@gmail.com>
2024-10-24 17:13:20 -06:00
Terry Howe ad9fb68fa3 feat: allow installation by OCI digest
Signed-off-by: Terry Howe <terrylhowe@gmail.com>
2024-10-24 08:25:47 -06:00
Nathan Baulch ff9dd262e3
Fix typos
Signed-off-by: Nathan Baulch <nathan.baulch@gmail.com>
2024-09-14 10:29:56 +10:00
Matt Farina c81bd8912e
Revert "Improve helm dependency update performance"
The change in #11726 caused a regression where `helm dependency udpate`
stopped working. The format of the internal representation of the data
changed causing errors of "non-absolute URLs should be in form of
repo_name/path_to_chart". See #13324 for more details.

Since this change is in released Helm and it's a regression, reverting
the original change was the fastest and safest route to deliver a
fix as quickly as possible.

Closes #13324

Signed-off-by: Matt Farina <matt.farina@suse.com>
2024-09-12 10:37:15 -04:00
MichaelMorris 9e5f465499 Merge branch 'helm:main' into fixDepUpPerformance
Signed-off-by: MichaelMorris <michael.morris@est.tech>
2024-08-02 00:03:15 +01:00
Suleiman Dibirov adeb4ca3d9 fix(dependencyBuild): prevent race condition in concurrent helm dependency
Signed-off-by: Suleiman Dibirov <idsulik@gmail.com>
2024-06-16 16:52:05 +03:00
Matt Clegg fff3547f9c
ISSUE-9507: ADD `application/gzip,application/octet-stream` accept header when downloading chart
Signed-off-by: Matt Clegg <m@cle.gg>
2024-05-14 15:58:30 +01:00
Jeff van Dam ee41b5f0fc Update manager_test.go
Signed-off-by: Jeff van Dam <jeff.van.dam@est.tech>
2024-04-29 14:29:08 +01:00
Jeff van Dam dc761caf00
Merge branch 'helm:main' into fixDepUpPerformance 2024-04-29 13:59:51 +01:00
Felipe Santos c86a8cbd53 perf(dep-up): do not update the same repo multiple times
Signed-off-by: Felipe Santos <felipecassiors@gmail.com>
2024-02-16 12:33:56 -03:00
Matt Farina 8e6a5149d2
validation fix
Signed-off-by: Matt Farina <matt.farina@suse.com>
2024-02-07 10:54:15 -05:00
Matt Farina 847369c184
Update to Go 1.21 for builds
Noteis:
1. This moves golangci scanning to a GitHub action. This will
   enable inline pointers to issues in the PR where linting fails.
2. Go 1.21 is specified in the go.mod because Kubernetes libs
   require it.
3. The lint issues were removed. Some were fixed while others
   were handled by skipping linting or using _ as an argument.
   Many of these can be refactored later for better cleanup.

Signed-off-by: Matt Farina <matt.farina@suse.com>
2024-01-08 15:48:36 -05:00
Matt Farina 70cbaa0a73
Merge pull request #11372 from vovtz/#11369-fix-custom-repo-cache-for-unmanaged-dependency-updates
#11369 Fix custom repo index cache directory for unmanaged dependency updates
2023-09-18 12:21:48 -04:00
Jeff van Dam 183f01b32c Made urls key more specific
Signed-off-by: Jeff van Dam <jeff.van.dam@est.tech>
2023-09-01 16:13:03 +01:00
Jeff van Dam 0a7bffdd3c Merge branch 'fixDepUpPerformance' of https://github.com/Nordix/helm into fixDepUpPerformance 2023-08-09 15:54:05 +01:00
Jeff van Dam e5fdaa1c65 Update chart_downloader.go
Signed-off-by: Jeff van Dam <66410239+JvD-Ericsson@users.noreply.github.com>
2023-08-09 15:53:57 +01:00