Commit graph

210 commits

Author SHA1 Message Date
Matt Farina
039b0b18d3
Handle messy index files
Signed-off-by: Matt Farina <matt.farina@suse.com>
(cherry picked from commit 69efc0d4fb)
2025-07-31 09:21:47 -04:00
Terry Howe
c188441757 chore(oci): upgrade to ORAS v2
Signed-off-by: Terry Howe <terrylhowe@gmail.com>
2025-03-14 08:46:18 -06:00
Matt Farina
145d12f82f
Merge pull request #13177 from bb-Ricardo/main
Improves handling of Helm index with broken helm chart versions #13176
2024-10-04 22:16:42 +02:00
ricardo.bartels@telekom.de
cdbef2b7d1
Revering change unrelated to issue #13176
Signed-off-by: ricardo.bartels@telekom.de <ricardo.bartels@telekom.de>
2024-10-04 16:01:18 -04:00
Nathan Baulch
ef85fa7f2d
Grammar fixes
Signed-off-by: Nathan Baulch <nathan.baulch@gmail.com>
2024-09-14 10:30:31 +10:00
Nathan Baulch
ff9dd262e3
Fix typos
Signed-off-by: Nathan Baulch <nathan.baulch@gmail.com>
2024-09-14 10:29:56 +10:00
ricardo.bartels@telekom.de
af13b0d8dc adds tests for handling of Helm index with broken chart versions #13176
Signed-off-by: ricardo.bartels@telekom.de <ricardo.bartels@telekom.de>
2024-07-14 11:51:13 +02:00
ricardo.bartels@telekom.de
154b477554 improves handling of Helm index with broken helm chart versions #13176
Signed-off-by: ricardo.bartels@telekom.de <ricardo.bartels@telekom.de>
2024-07-12 17:22:10 +02:00
Robert Sirchia
d58d7b3762 Fixing all the linting errors
Cleaned up all the linting errors we are getting.

Signed-off-by: Robert Sirchia <rsirchia@outlook.com>
2024-03-11 17:13:34 -04:00
Matt Farina
764557c470
Some fixes
Signed-off-by: Matt Farina <matt.farina@suse.com>
2024-02-21 09:45:58 -05:00
George Jenkins
8d19bcb78a add error messages
Signed-off-by: George Jenkins <gvjenkins@gmail.com>
2024-02-08 11:07:36 -08:00
George Jenkins
68294fdae0 Fix: Ignore alias validation error for index load
Signed-off-by: George Jenkins <gvjenkins@gmail.com>
2024-02-08 09:08:09 -08: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
5a1475ee36
Merge pull request #11294 from Juneezee/test/t.TempDir
test: replace `ensure.TempDir` with `t.TempDir`
2023-09-14 09:55:51 -04:00
Eng Zer Jun
2ceebffc77
test: replace ensure.TempDir with t.TempDir
This commit replaces `ensure.TempDir` with `t.TempDir` in tests. The
directory created by `t.TempDir` is automatically removed when the test
and all its subtests complete.

Prior to this commit, temporary directory created using `ensure.TempDir`
needs to be removed manually by calling `os.RemoveAll`, which is omitted
in some tests. The error handling boilerplate e.g.
	defer func() {
		if err := os.RemoveAll(dir); err != nil {
			t.Fatal(err)
		}
	}
is also tedious, but `t.TempDir` handles this for us nicely.

Reference: https://pkg.go.dev/testing#T.TempDir
Signed-off-by: Eng Zer Jun <engzerjun@gmail.com>
2023-07-29 16:11:22 +08:00
Hidde Beydals
2544aa23a3
cmd: support generating index in JSON format
This adds support for generating the repository index file in JSON
format using the `--json` flag. The index itself is still written
to `index.yaml`, which is fully backwards compatible as YAML is a
superset of JSON.

For big indexes (think multiple megabytes), this approach is however
more efficient in combination with the changes to the load logic,
as it prevents a YAML -> JSON roundtrip during decoding.

Signed-off-by: Hidde Beydals <hidde@hhh.computer>
2023-07-21 08:30:54 +02:00
Hidde Beydals
e21c9cf7e2
repo: detect JSON and unmarshal efficiently
When an index is in a JSON format, the `sigs.k8s.io/yaml` package uses
an inefficient approach to unmarshaling the data, as it does an
unnecessary roundtrip on the data to transform the YAML to valid JSON.

To prevent this from happening, detect if the bytes which we attempt
to load contain valid JSON, and unmarshal them directly using
`json.Unmarshal` instead.

Signed-off-by: Hidde Beydals <hidde@hhh.computer>
2023-07-21 00:23:43 +02:00
Matt Farina
1c4885fce7
Merge pull request #11501 from imanushin/add-test-for-exact-version
Add test for exact version selection
2023-05-30 12:58:14 -04:00
Joe Julian
d7805e68ae
Merge pull request #11455 from ksankeerth/dev-11451
Strict file permissions for repository.yaml
2023-05-25 11:25:19 -07:00
Matt Farina
4e7e939f19
Updating the Go version in go.mod
At this time both Go 1.19 and 1.20 are supported. The version
specified in the go.mod file is the minimum version we expect Helm
to be compiled against. This is the oldest supported version to
support environments where others compile Helm. The Helm project
is using Go 1.20 to build Helm itself.

Updating to Go 1.19 also includes dealing with io/ioutil
deprecation and some additional linting issues around staticcheck.
All the staticcheck issues were in test files so linting was
skipped for those.

Signed-off-by: Matt Farina <matt.farina@suse.com>
2023-03-22 11:52:30 -04:00
Matt Farina
50c22ed7f9
Bump the Go version
Needed to gofmt source to meet changes in style

Signed-off-by: Matt Farina <matt.farina@suse.com>
2023-03-22 11:29:26 -04:00
Andrew Block
08593c8dd6
Added support for insecure OCI registries
Signed-off-by: Andrew Block <andy.block@gmail.com>
2023-03-03 07:33:17 -06:00
Jakub Warczarek
2fa7b3d1b7 Fix User-Agent header in requests made by Helm
Signed-off-by: Jakub Warczarek <jakub.warczarek@gmail.com>
2023-01-03 23:13:11 +01:00
Matt Farina
71ef5f477b
Merge pull request #11524 from sap-contributions/harmonize-url-reference-resolving
harmonize URL reference resolving
2023-01-03 09:02:12 -05:00
Matt Farina
5a8e91a010
Merge pull request #11604 from xishengcai/patch-1
Update chartrepo.go
2022-12-19 17:34:50 -05:00
caixisheng
c8890e971e
Update chartrepo.go
## case :
1. charmuseum is http
2. nginx https ---> chartmuseum
3. domain, CN is IP

## result:  
 error: failed to prepare chart for release: chart unavailable: looks like "https://120.55.54.50" is not a valid chart repository or cannot be reached: Get "https://120.55.54.50/index.yaml": x509: certificate relies on legacy Common Name field, use SANs instead



Signed-off-by: caixisheng <cc710917049@163.com>
2022-12-05 23:04:16 +08:00
Martin Hickey
256e976331 Update repo handling
Signed-off-by: Martin Hickey <martin.hickey@ie.ibm.com>
2022-11-22 15:22:10 +00:00
Philipp Stehle
dfb25e13de harmonize URL reference resolving
Fixes https://github.com/helm/helm/issues/11472

Signed-off-by: Philipp Stehle <philipp.stehle@sap.com>
2022-11-09 10:26:45 +01:00
Igor Manushin
203f31d57b Add exact version test. See also #7563
Signed-off-by: Igor Manushin <igor.manushin@gmail.com>
2022-11-03 19:42:12 +00:00
shankeerthan-kasilingam
33121a80ff strict file permissions of repository.yaml
Fixes #11451

Signed-off-by: shankeerthan-kasilingam <shankeerthan1995@gmail.com>
2022-10-24 06:36:07 +05:30
Matt Farina
90a25751bd
Merge pull request #11172 from crenshaw-dev/cleanup-after-find-chart
fix: clean up temp files in FindChartInAuthAndTLSAndPassRepoURL (#11171)
2022-10-11 13:58:46 -04:00
Martin Hickey
ae828ce0ee Fix code style
Signed-off-by: Martin Hickey <martin.hickey@ie.ibm.com>
2022-09-21 16:35:29 +01:00
CI
c1bf99c0eb Merge remote-tracking branch 'origin/main' into cleanup-after-find-chart 2022-09-06 08:32:06 -04:00
CI
3b19ddeb56 one defer
Signed-off-by: CI <ci@argoproj.com>
2022-08-05 10:02:18 -04:00
CI
781ddba690 don't change r.CachePath
Signed-off-by: CI <ci@argoproj.com>
2022-07-29 16:12:16 -04:00
Matt Farina
b3aa0b4118
Fixing x509 test on darwin
Go passes x509 verification off to the platform and different
platforms provide different responses. The Go tests for x509
even have different test files for different platform providers
that check for different messages.

This update haldes darwins difference for x509 authority handling

Closes #11159

Signed-off-by: Matt Farina <matt@mattfarina.com>
2022-07-27 12:48:52 -04:00
CI
cd76fcd805 avoid adding new public function
Signed-off-by: CI <ci@argoproj.com>
2022-07-22 12:58:54 -04:00
CI
32a41fcfac fix tests
Signed-off-by: CI <ci@argoproj.com>
2022-07-21 12:42:56 -04:00
CI
24fa3d910d fix: clean up temp files in FindChartInAuthAndTLSAndPassRepoURL (#11171)
Signed-off-by: CI <ci@argoproj.com>
2022-07-21 12:29:14 -04:00
Soule BA
42a04c76a4
make token caching an opt in feature
If implemented, users have to opt in to cache a token.

Signed-off-by: Soule BA <bah.soule@gmail.com>
2022-06-27 14:23:25 +02:00
Markus Lehtonen
7a08426869 repo: fix repo merge unit test
Enable asserts that accidentally excluded from normal test flow.

Signed-off-by: Markus Lehtonen <markus.lehtonen@intel.com>
2022-03-15 09:07:05 +02:00
Eng Zer Jun
2e3e22a003
test: use T.TempDir to create temporary test directory
The directory created by `T.TempDir` is automatically removed when the
test and all its subtests complete.

Reference: https://pkg.go.dev/testing#T.TempDir
Signed-off-by: Eng Zer Jun <engzerjun@gmail.com>
2022-02-12 13:54:54 +08: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
Josh Dolitsky
0121f6a328
Merge branch 'main' of github.com:helm/helm into hip-6
Signed-off-by: Josh Dolitsky <josh@dolit.ski>
2021-08-26 16:51:02 -04:00
Matthew Fisher
8d8a27ed1f
Merge pull request #9980 from schra/feat/password-stdin
feat(helm): add --password-stdin to `helm repo add`
2021-08-20 09:39:26 -07:00
John Howard
82a2abf512 Update oras-go to v0.4.0
Signed-off-by: John Howard <howardjohn@google.com>
2021-08-19 08:33:22 -07:00
Matthew Fisher
92bd9558e5
Merge pull request #9998 from bacongobbler/distribution-v3
Switch to distribution v3
2021-08-18 19:36:35 -07:00
André Schröder
2131f4cba8 [fix concern] implement test
Signed-off-by: André Schröder <andre.schroedr@gmail.com>
2021-08-18 15:03:13 +02:00
Martin Hickey
d83dd95cae
Merge pull request #9774 from yxxhero/fix_msg_when_index_yaml_empty
Add a more friendly prompt when index.yaml is empty.
2021-08-18 09:59:46 +01:00
Matthew Fisher
4801818f7c
Switch to distribution v3
Signed-off-by: Matthew Fisher <matt.fisher@microsoft.com>
2021-08-04 09:21:55 -07:00