Commit graph

48 commits

Author SHA1 Message Date
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
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
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
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
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
Nathan Baulch
ef85fa7f2d
Grammar fixes
Signed-off-by: Nathan Baulch <nathan.baulch@gmail.com>
2024-09-14 10:30:31 +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
Andreas Sommer
ac75eae98c Add error details when a dependent chart's version cannot be found in a repo
Signed-off-by: Andreas Sommer <andreas.sommer87@googlemail.com>
2024-04-10 12:04:26 +02: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
JvD_Ericsson
1ce7939838 Improve helm dependency update performance
What this PR does / why we need it:
This PR was created to improve performance of the dependency update command by
skipping unnecessary downloading and loading of index files that have already
been downloaded and loaded

I believe this would close refs #9865

Signed-off-by: Jeff van Dam <jeff.van.dam@est.tech>
2023-04-24 17:35:50 +01:00
Andrew Block
01ff5bb00d
Avoid querying for OCI tags can explicit version provided in chart dependencies
Signed-off-by: Andrew Block <andy.block@gmail.com>
2022-01-30 15:53:08 -06:00
David Peraza
9f869c6b21 Removing all the checks for oci experimental flag
Signed-off-by: David Peraza <dperaza@redhat.com>
2022-01-12 21:49:26 -05:00
Thomas Runyon
353d74e967 refactor internal/experimental/registry to pkg/registry
Signed-off-by: Thomas Runyon <runyontr@gmail.com>
2022-01-12 21:49:26 -05:00
Andrew Block
9c3b000889
Fixed bad commit
Signed-off-by: Andrew Block <andy.block@gmail.com>
2022-01-11 21:05:28 -06:00
Andrew Block
828941b273
Readded resolver OCI logic
Signed-off-by: Andrew Block <andy.block@gmail.com>
2022-01-11 20:54:47 -06:00
Andrew Block
4f62d3dc1b
Started work on 'helm pull'
Signed-off-by: Andrew Block <andy.block@gmail.com>
2022-01-11 21:47:03 -05:00
Andrew Block
df98e18eb7
Working oci code without providing versions
Signed-off-by: Andrew Block <andy.block@gmail.com>
2022-01-11 21:47:03 -05:00
Andrew Block
0fae7f5008
Updated tag resolver logic
Signed-off-by: Andrew Block <andy.block@gmail.com>
2022-01-11 21:47:03 -05:00
Andrew Block
834a11db56
Added registryClient to resolver
Signed-off-by: Andrew Block <andy.block@gmail.com>
2022-01-11 21:47:03 -05:00
Scott Rigby
e3f2fb4235
Add OCI tag verions to the Dependency object before Resolve. TODO: fix HTTP HTTPS error for local registries
Signed-off-by: Scott Rigby <scott@r6by.com>
2022-01-11 21:45:30 -05:00
Scott Rigby
3dc9930488
Revert "hack in progress"
This reverts commit c0be414e4b8d2928018504c010cb04b1b2450bf3.

Taking a different approach, but keep this work in git history for now until we
know the new approach works.

Signed-off-by: Scott Rigby <scott@r6by.com>
2022-01-11 21:45:30 -05:00
Scott Rigby
0d2f0116ea
hack in progress
Signed-off-by: Scott Rigby <scott@r6by.com>
2022-01-11 21:44:49 -05:00
Josh Dolitsky
f0a528ec05
Merge branch 'main' of github.com:helm/helm into hip-6
Signed-off-by: Josh Dolitsky <josh@dolit.ski>
2021-08-05 23:17:08 -04:00
Víctor Cuadrado Juan
84a07a4774
test: Make internal/resolver/resolver_test.go pass on Win
TestGetLocalPath() needs Windows-specific expected strings.

Signed-off-by: Víctor Cuadrado Juan <vcuadradojuan@suse.de>
2021-07-26 16:53:18 +02:00
Josh Dolitsky
593eac8876
Merge branch 'main' of github.com:helm/helm into hip-6
Signed-off-by: Josh Dolitsky <josh@dolit.ski>
2021-07-07 10:35:34 -05:00
Josh Dolitsky
230e37ca52
remove hardcoded oci strings, add constant/util
Signed-off-by: Josh Dolitsky <josh@dolit.ski>
2021-06-28 12:43:33 -04:00
cndoit18
402c7f1a52
fix(dep update): helm dep update is not respecting the "version" stipulated in the requirements
Signed-off-by: cndoit18 <cndoit18@outlook.com>
2021-05-25 22:33:02 +08:00
Josh Soref
2bf8fdf45d
chore: Spelling (#9410)
* spelling: annotate

Signed-off-by: Josh Soref <jsoref@users.noreply.github.com>

* spelling: asserts

Signed-off-by: Josh Soref <jsoref@users.noreply.github.com>

* spelling: behavior

Signed-off-by: Josh Soref <jsoref@users.noreply.github.com>

* spelling: binary

Signed-off-by: Josh Soref <jsoref@users.noreply.github.com>

* spelling: contain

Signed-off-by: Josh Soref <jsoref@users.noreply.github.com>

* spelling: copied

Signed-off-by: Josh Soref <jsoref@users.noreply.github.com>

* spelling: dependency

Signed-off-by: Josh Soref <jsoref@users.noreply.github.com>

* spelling: depending

Signed-off-by: Josh Soref <jsoref@users.noreply.github.com>

* spelling: deprecated

Signed-off-by: Josh Soref <jsoref@users.noreply.github.com>

* spelling: doesn't

Signed-off-by: Josh Soref <jsoref@users.noreply.github.com>

* spelling: donot

Signed-off-by: Josh Soref <jsoref@users.noreply.github.com>

* spelling: github

Signed-off-by: Josh Soref <jsoref@users.noreply.github.com>

* spelling: inputting

Signed-off-by: Josh Soref <jsoref@users.noreply.github.com>

* spelling: iteration

Signed-off-by: Josh Soref <jsoref@users.noreply.github.com>

* spelling: jabberwocky

Signed-off-by: Josh Soref <jsoref@users.noreply.github.com>

* spelling: kubernetes

Signed-off-by: Josh Soref <jsoref@users.noreply.github.com>

* spelling: length

Signed-off-by: Josh Soref <jsoref@users.noreply.github.com>

* spelling: mismatch

Signed-off-by: Josh Soref <jsoref@users.noreply.github.com>

* spelling: multiple

Signed-off-by: Josh Soref <jsoref@users.noreply.github.com>

* spelling: nonexistent

Signed-off-by: Josh Soref <jsoref@users.noreply.github.com>

* spelling: outputs

Signed-off-by: Josh Soref <jsoref@users.noreply.github.com>

* spelling: panicking

Signed-off-by: Josh Soref <jsoref@users.noreply.github.com>

* spelling: plugins

Signed-off-by: Josh Soref <jsoref@users.noreply.github.com>

* spelling: parsing

Signed-off-by: Josh Soref <jsoref@users.noreply.github.com>

* spelling: porthos

Signed-off-by: Josh Soref <jsoref@users.noreply.github.com>

* spelling: regular

Signed-off-by: Josh Soref <jsoref@users.noreply.github.com>

* spelling: resource

Signed-off-by: Josh Soref <jsoref@users.noreply.github.com>

* spelling: repositories

Signed-off-by: Josh Soref <jsoref@users.noreply.github.com>

* spelling: something

Signed-off-by: Josh Soref <jsoref@users.noreply.github.com>

* spelling: strict

Signed-off-by: Josh Soref <jsoref@users.noreply.github.com>

* spelling: string

Signed-off-by: Josh Soref <jsoref@users.noreply.github.com>

* spelling: unknown

Signed-off-by: Josh Soref <jsoref@users.noreply.github.com>
2021-03-15 21:11:57 -04:00
Adam Reese
657ce552cb
fix(*): Validate metadata semver and printable characters
ref: https://github.com/helm/helm/security/advisories/GHSA-c38g-469g-cmgx

* Skip invalid chart versions when reading the repository index file or
  when programmatically adding a chart version.
* Adds semver validation and strips non-printable characters and
  normalizes spaces for string fields in Metadata.Validate()
* Fixes a unit test that was pulling a remote repo.  Now uses a local
  repo.
* Fixes ignored error in repo update command

Signed-off-by: Adam Reese <adam@reese.io>
2021-02-04 12:52:24 -08:00
Peter Engelbert
3028c55858 Clean up imports and add doc comments
Additionally, revert `NewPull()` to its existing signature.

Signed-off-by: Peter Engelbert <pmengelbert@gmail.com>
2020-12-11 21:44:46 -06:00
Peter Engelbert
3ad08f3ea9 Implement helm pull for OCI registries
* Implement `helm dep update` for oci dependencies
* New unit tests
* Remove `helm chart pull` command
* New `helm pull` does not depend on registry cache

Signed-off-by: Peter Engelbert <pmengelbert@gmail.com>
2020-12-11 21:44:30 -06:00
Matt Butcher
fe2d7f7792
this rewrites a whole bunch of old repo URLs to the new repo URL (#8902)
Signed-off-by: Matt Butcher <matt.butcher@microsoft.com>
2020-10-19 14:38:32 -06:00
Matt Farina
ff147e9ed7
Locking file URIs to a version in lockfile
Previously, if a range was specified for a file:// url as a
dependency the range would be put in the lockfile. Lockfiles are
designed to pin to a specific version and not support ranges. This
is for reproducibility.

The change here pins to a the specific version of the chart
specified using the file:// when update is run.

Signed-off-by: Matt Farina <matt@mattfarina.com>
2020-07-22 15:42:26 -04:00
Adam Reese
44a2225035
ref(tests): localize unit test fixtures to package
Use test fixtures that are in the same package as test.

Signed-off-by: Adam Reese <adam@reese.io>
2020-05-22 11:39:20 -07:00
Martin Hickey
5ec70ab27f
fix(chart): lock digest differs when dependency build with Helm 2 and then Helm 3 (#7261)
* Fix issue with apiVersion v1 lock digest

When apiVersion v1 chart dependencies are built with Helm 2
and then built with Helm 3, the lock digests differ. To avoid
this issue, a depdendency update is forced.

Signed-off-by: Martin Hickey <martin.hickey@ie.ibm.com>

* Check against Helm v2 hash

Handle scenario where dependency hash was generated by Helm v2
but need to do a dependency build with Helm v3.

Signed-off-by: Martin Hickey <martin.hickey@ie.ibm.com>

* Add unit test

Signed-off-by: Martin Hickey <martin.hickey@ie.ibm.com>

* Refactor unit test

Refactor unit test to use an existing chart as dependency

Signed-off-by: Martin Hickey <martin.hickey@ie.ibm.com>

* Update after review

Comments:
- https://github.com/helm/helm/pull/7261#discussion_r373827088
- https://github.com/helm/helm/pull/7261#discussion_r373827250

Signed-off-by: Martin Hickey <martin.hickey@ie.ibm.com>
2020-02-05 09:38:30 +01:00
Marc Khouzam
1897d4d60a fix(tests): Make tests pass on MacOS
This newly added tests was failing on MacOS because /proc does not
exist.  This commit replaces /proc with /tmp to achieve the same result.

Signed-off-by: Marc Khouzam <marc.khouzam@montreal.ca>
2020-02-03 09:20:55 -05:00
Guangwen Feng
476200ed06 Add corresponding unit test to the function in resolver.go
Signed-off-by: Guangwen Feng <fenggw-fnst@cn.fujitsu.com>
2020-01-03 18:21:17 +08:00
Hang Park
c72caf6a11
fix(pkg/downloader): Calculate digest from both Chart.lock & Chart.yaml deps
To make digests include information about Chart.yaml dependencies, not
only the lock file, digest calculation is changed to accept both
contents. This terminates the `dep build` command if Chart.yaml
dependencies have been updated so that `dep up` should be executed
properly, to prevent downloading wrong versions or mismatched subcharts.

Note that previous Helm cannot know whether Chart.yaml dependencies were changed
or not since the Chart.lock's digest is calculated by only Chart.lock
contents, which don't include information about SemVer ranges and extra
dependency fields such as aliases, conditions, and tags. Specially,
SemVer can be written as a version range in Chart.yaml, but Chart.lock
has the specific, resolved version of that range.

Signed-off-by: Hang Park <hangpark@kaist.ac.kr>
2019-10-27 22:48:19 +09:00
Matthew Fisher
40572311ab
Merge pull request #6488 from bacongobbler/port-6258
fix(downloader): bypass index cache when repository URL defined
2019-10-16 09:10:06 -07:00
Martin Hickey
f2aa97e313
fix(helm): Port accept dependency in requirements.yaml from charts directory (#6611)
* Port #6578 to Helm 3

Signed-off-by: Martin Hickey <martin.hickey@ie.ibm.com>

* Update after reviw

Review comments:
- https://github.com/helm/helm/pull/6611#discussion_r332745703

Signed-off-by: Martin Hickey <martin.hickey@ie.ibm.com>
2019-10-09 16:35:55 +01:00
Matthew Fisher
b02080dc2c
fix(downloader): bypass index cache when repository URL defined
Signed-off-by: Matthew Fisher <matt.fisher@microsoft.com>
2019-10-03 12:37:05 -07:00
Matt Farina
9bc7934f35
Updating the module for v3 as the major version
Signed-off-by: Matt Farina <matt@mattfarina.com>
2019-10-03 14:27:05 -04:00
Matt Farina
967f4fed42
Update dependencies
* Kubernetes updated to 1.16.1
* SemVer and Sprig updated to latest releases that leverage go
  modules
* Tests and checks updated. These already landed in v2 via PR 6457

Signed-off-by: Matt Farina <matt@mattfarina.com>
2019-10-03 13:49:07 -04:00
Adam Reese
1779ad5302
ref(cmd/helm): remove init command
Signed-off-by: Adam Reese <adam@reese.io>
2019-08-26 10:21:52 -07:00
Adam Reese
b6fdd8783b
feat(cmd/helm): remove need for helm init command
* allow repository config via cli
* make `helm repo add` create repo config file if it does not exist
* squash a ton of bugs

Signed-off-by: Adam Reese <adam@reese.io>
2019-08-22 23:31:50 -07:00
Taylor Thomas
c9c95ea148 ref(*): Moves packages to internal
These packages are generally used only for logic inside of Helm and
can later be re-exported as needed

Signed-off-by: Taylor Thomas <taylor.thomas@microsoft.com>
2019-08-09 16:02:33 -06:00