Commit graph

58 commits

Author SHA1 Message Date
Dirk Müller
1b75d48189
Update testdata PKI with keys that have validity until 3393 (Fixes #12880)
The ca.crt had to be regenerated because there was no ca.key. Added
new ca.key so that going forward only the certs need to be updated.

Signed-off-by: Dirk Müller <dirk@dmllr.de>
2024-04-21 12:57:04 +02:00
Matt Farina
a753ee7f43
Merge pull request #12866 from robertsirc/Correcting-Linting-Errors
Correcting linting errors
2024-04-10 14:04:34 -04:00
Andrew Block
0a69a0dea6
Modified how created annotation is populated based on package creation time
Signed-off-by: Andrew Block <andy.block@gmail.com>
2024-03-22 06:34:08 -05: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
24e2864c64
Revert "fix(main): fix basic auth for helm pull or push"
This reverts commit 4a27baaffc.

Note, PR #11129 was layered in along with this change so the revert
preserves this API addition.

Signed-off-by: Matt Farina <matt.farina@suse.com>
2023-10-26 10:11:56 -04:00
Matt Farina
992dc58556
Revert "fix(registry): address anonymous pull issue"
Signed-off-by: Matt Farina <matt.farina@suse.com>
2023-10-25 14:46:53 -04:00
Matt Farina
ff8f0276ca
Merge pull request #12429 from hiddeco/fix-swallowed-err
fix(registry): unswallow error
2023-10-09 13:06:33 -04:00
Hidde Beydals
fe4c01f624
fix(registry): address anonymous pull issue
The assumption that either a username and/or password OR an error is
returned appears to be wrong, and results in an error later on which
looks something like the following:

```
failed to authorize: failed to fetch anonymous token: unexpected status
from GET request to https://auth.docker.io/token?scope=repository%3AXXX%2FYYY%3Apull&service=registry.docker.io:
401 Unauthorized
```

To mitigate this, confirm we actually have one of the values before
setting the `Authorization` header.

Co-authored-by: Joe Julian <me@joejulian.name>
Signed-off-by: Hidde Beydals <hidde@hhh.computer>
2023-09-29 09:24:19 +02:00
Hidde Beydals
da3c666a82
fix(registry): unswallow error
Signed-off-by: Hidde Beydals <hidde@hhh.computer>
2023-09-28 22:57:41 +02:00
Antonio Gamez Diaz
3607cd7110
Avoid nil dereference if passing a nil resolver
Signed-off-by: Antonio Gamez Diaz <agamez@vmware.com>
2023-08-09 23:53:56 +02:00
Antonio Gamez Diaz
197d1defbf
Add required changes after merge
Signed-off-by: Antonio Gamez Diaz <agamez@vmware.com>
2023-08-09 11:40:57 +02:00
Antonio Gamez Diaz
ad6f45819a
Merge branch 'main'
Signed-off-by: Antonio Gamez Diaz <agamez@vmware.com>

Conflicts:
	pkg/registry/client.go
	pkg/registry/utils_test.go
2023-08-09 11:38:39 +02:00
Joe Julian
819931b226
Merge pull request #12237 from cuisongliu/auth_basic
fix(main): fix basic auth for helm pull or push
2023-08-01 16:04:43 -07:00
Scott Rigby
7d190be0d0
Merge pull request #12128 from aryan9600/plain-http
oci: Add flag --plain-http to enable working with HTTP registries
2023-08-01 14:32:06 -04:00
cuisongliu
4a27baaffc fix(main): fix basic auth for helm pull or push
Signed-off-by: cuisongliu <cuisongliu@qq.com>
2023-07-22 20:33:48 +08:00
Andrew Block
d72b42da61
Added tests for created OCI annotation time format
Signed-off-by: Andrew Block <andy.block@gmail.com>
2023-07-04 04:51:46 -05:00
Andrew Block
c4870d990c
Add created OCI annotation
Signed-off-by: Andrew Block <andy.block@gmail.com>
2023-07-02 07:21:15 -05:00
Sanskar Jaiswal
6defb96dac
oci: add tests for plain HTTP and insecure HTTPS registries
Signed-off-by: Sanskar Jaiswal <jaiswalsanskar078@gmail.com>
2023-06-14 23:53:33 +05:30
Sanskar Jaiswal
2538b927a7
oci: Add flag --plain-http to enable working with HTTP registries
Add a new flag `--plain-http` to the following commands:
* `helm install`
* `helm pull`
* `helm push`
* `helm template`
* `helm upgrade`
* `helm show`

This flag instructs the registry client to use plain HTTP connections,
thus enabling upload/download of charts from OCI registries served at
an HTTP endpoint.

Signed-off-by: Sanskar Jaiswal <jaiswalsanskar078@gmail.com>
2023-06-09 14:43:53 +05:30
Antonio Gamez Diaz
770c51ef0a
Add ClientOptResolver to test util file
Signed-off-by: Antonio Gamez Diaz <agamez@vmware.com>
2023-05-12 11:45:51 +02:00
Antonio Gamez Diaz
e43ffb807e
Merge branch 'main'
Signed-off-by: Antonio Gamez Diaz <agamez@vmware.com>

Conflicts:
	pkg/registry/client.go
	pkg/registry/client_test.go
2023-05-12 11:44:10 +02:00
Andrew Block
f900e9f1b1
Attach annotations to OCI artifacts
Signed-off-by: Andrew Block <andy.block@gmail.com>
2023-04-29 08:10:04 -05:00
Matt Farina
046646c944
Handle failed DNS case for Go 1.20+
Go 1.20 introduced DNS/CNAME handling changes. This can cause an
IP address represented in hex, oct, etc to be looked up as DNS and
fail. This change introduces a mock DNS resolver.

Note, with the mock resolver, we don't need to use 0x7f000001 any
longer. Keeping because it was already there.

Signed-off-by: Matt Farina <matt.farina@suse.com>
2023-03-23 13:22:07 -04: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
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
Soule BA
b0ecb21056
Enable custom certificates option for OCI
If implemented, users will be able to use custom certificates and CA to
while interacting with OCI registries.

Signed-off-by: Soule BA <bah.soule@gmail.com>
2023-03-03 07:33:17 -06:00
Antonio Gamez Diaz
62be6f1af6
ref(helm): export DescriptorPullSummary fields
Exporting those fields enable 3rd party users to build their own mocked PullResult responses.

Related #10623

Signed-off-by: Antonio Gamez Diaz <agamez@vmware.com>
2022-07-08 21:15:14 +02:00
Antonio Gamez Diaz
80bc7df782
feat(helm): add 'ClientOptResolver' ClientOption
This is a way to make the containerd resolver configurable by third-party users.

Related #10623

Signed-off-by: Antonio Gamez Diaz <agamez@vmware.com>
2022-07-08 21:14:06 +02: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
Josh Dolitsky
59dbda915f
Merge pull request #10558 from sabre1041/bearer-token-oci
Management of bearer tokens for tag listing
2022-01-26 10:06:50 -06:00
Martin Hickey
f0fd37d2c5 Replace golint with revive
golint which is used as one of the sublinters in golangci-lint is deprecated.
It is replaced with revive which is a drop-in replacement.

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

Co-authored-by: Martin Mulholland <mmulholl@redhat.com>
2022-01-20 15:19:40 +00:00
Andrew Block
c8a2559236
Management of bearer tokens for tag listing
Signed-off-by: Andrew Block <andy.block@gmail.com>
2022-01-14 19:52:54 -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
91a46ad14f move paths for updated directory location
Signed-off-by: Thomas Runyon <runyontr@gmail.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
Matthew Fisher
fe952445bd
feat(cmd): put OCI commands behind a feature gate
This adds a new `gates` package used for interacting with feature gates. It also marks the OCI registry work as experimental, signalling to users that it is not a stable feature of Helm.

Signed-off-by: Matthew Fisher <matt.fisher@microsoft.com>
2019-08-08 15:25:17 -07:00
Matthew Fisher
2045fab01f
ref(action): remove ParseReferenceWithChartDefaults
Signed-off-by: Matthew Fisher <matt.fisher@microsoft.com>
2019-07-23 14:33:23 -07:00
Josh Dolitsky
b3fd254991 Use chart version as default tag when saving
Signed-off-by: Josh Dolitsky <jdolitsky@gmail.com>
2019-07-22 10:24:52 -05:00
Marc Khouzam
81321532e6 Fix linter issuers
Signed-off-by: Marc Khouzam <marc.khouzam@ville.montreal.qc.ca>
2019-07-05 08:07:03 -04:00
Josh Dolitsky
240dd53e78
Helm 3: set custom manifest config media type on chart push (#5719)
* set custom manifest config media type

Signed-off-by: Josh Dolitsky <jdolitsky@gmail.com>

* use v1 for manifest schema

Signed-off-by: Josh Dolitsky <jdolitsky@gmail.com>

* remove unneeded debug flag

Signed-off-by: Josh Dolitsky <jdolitsky@gmail.com>

* update to new config media type

Signed-off-by: Josh Dolitsky <jdolitsky@gmail.com>
2019-07-03 15:00:16 -05:00
Josh Dolitsky
5f1128b5f7 pass debug option to registry client
Signed-off-by: Josh Dolitsky <jdolitsky@gmail.com>
2019-05-10 10:44:46 -05:00
Josh Dolitsky
a12a396aab
Helm 3: registry login/logout (#5597)
* login/logout placeholders

Signed-off-by: Josh Dolitsky <jdolitsky@gmail.com>

* use latest oras

Signed-off-by: Josh Dolitsky <jdolitsky@gmail.com>

* use docker auth system

Signed-off-by: Josh Dolitsky <jdolitsky@gmail.com>

* working login+push

Signed-off-by: Josh Dolitsky <jdolitsky@gmail.com>

* working on tests

Signed-off-by: Josh Dolitsky <jdolitsky@gmail.com>

* fix typo in htpasswd

Signed-off-by: Josh Dolitsky <jdolitsky@gmail.com>

* rename credsfile to config.json

Signed-off-by: Josh Dolitsky <jdolitsky@gmail.com>

* add flags for username/password

Signed-off-by: Josh Dolitsky <jdolitsky@gmail.com>

* disable logout test broken on linux

Signed-off-by: Josh Dolitsky <jdolitsky@gmail.com>

* upgrade to oras 0.4.0

Signed-off-by: Josh Dolitsky <jdolitsky@gmail.com>

* re-enable logout test

Signed-off-by: Josh Dolitsky <jdolitsky@gmail.com>

* panic for uncaught errors

Signed-off-by: Josh Dolitsky <jdolitsky@gmail.com>

* move login/logout to new registry subcommand

Signed-off-by: Josh Dolitsky <jdolitsky@gmail.com>
2019-05-06 16:15:34 -05:00
Adam Reese
e458a67f0c
ref(pkg/chart): add validation method to chart
Consolidate validation of Chart.yaml.

Signed-off-by: Adam Reese <adam@reese.io>
2019-04-05 13:40:06 -07:00
Adam Reese
295092cd7d
ref(pkg/action): refactoring dup code and linter fixes
Signed-off-by: Adam Reese <adam@reese.io>
2019-03-26 11:11:27 -07:00
Adam Reese
895e9192d4
feat(*): use vanity import helm.sh/helm
Signed-off-by: Adam Reese <adam@reese.io>
2019-03-13 13:43:47 -07:00
Adam Reese
21d3a40f3b
feat(tests): replace gometalinter with golangci-lint
Signed-off-by: Adam Reese <adam@reese.io>
2019-03-08 11:45:42 -08:00
Adam Reese
e51a9b90c9
Merge pull request #5284 from adamreese/v3/make-format
feat(Makefile): add formatting target
2019-02-14 23:40:50 -08:00
Martin Hickey
45fb4b1c44 Fix linter warnings
Signed-off-by: Martin Hickey <martin.hickey@ie.ibm.com>
2019-02-12 18:18:33 +00:00
Adam Reese
f791421fab
feat(Makefile): add formatting target
Signed-off-by: Adam Reese <adam@reese.io>
2019-02-08 12:24:47 -08:00
Josh Dolitsky
16b59bfe5b
Helm 3: fix "latest" tag bug (#5279)
* add extra ref parsing, validation

Signed-off-by: Josh Dolitsky <jdolitsky@gmail.com>

* add fix for missing locator

Signed-off-by: Josh Dolitsky <jdolitsky@gmail.com>

* add repo and tag fields for clarity

Signed-off-by: Josh Dolitsky <jdolitsky@gmail.com>

* small refector

Signed-off-by: Josh Dolitsky <jdolitsky@gmail.com>
2019-02-08 14:17:42 -06:00