Commit graph

76 commits

Author SHA1 Message Date
Terry Howe
1435ec7c77 Update pkg/registry/fallback.go
Signed-off-by: Terry Howe <terrylhowe@gmail.com>
2025-03-14 08:46:25 -06:00
Terry Howe
674e882c88 automatic fallback to http
Signed-off-by: Terry Howe <terrylhowe@gmail.com>
2025-03-14 08:46:25 -06: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
Terry Howe
949b2e6040 fix: make ORAS reference private
Signed-off-by: Terry Howe <terrylhowe@gmail.com>
(cherry picked from commit d2b94f6200)
2025-01-01 11:50:58 -05:00
Terry Howe
aba95b9cb4 fix: issue with helm template and oci chart
Signed-off-by: Terry Howe <terrylhowe@gmail.com>
(cherry picked from commit aca7e8d775)
2025-01-01 11:50:43 -05:00
Terry Howe
c3e5217d85 feat: allow installation by OCI digest
Signed-off-by: Terry Howe <terrylhowe@gmail.com>
(cherry picked from commit ad9fb68fa3)
2025-01-01 11:50:26 -05:00
Matt Farina
391a90752d
Merge pull request #13512 from gjenkins8/shadow_oras_remoteclient_type
fix: Shadow ORAS remote.Client interface [v3 backport]
2024-12-30 14:19:38 +01:00
Matt Farina
9f620b857a Update to Go 1.23
Multiple changes were made to pass linting. Some Go built-in names
are being used for variables (e.g., min). This happens in the Go
source itself including the Go standard library and is not always
a bad practice.

To handle allowing some built-in names to be used the linter config
is updated to allow (via opt-in) some names to pass. This allows us
to still check for re-use of Go built-in names and opt-in to any
new uses.

There were also several cases where a value was checked for nil
before checking its length when this is already handled by len()
or the types default value. These were cleaned up.

The license validation was updated because it was checking everything
in the .git directory including all remote content that was local.
The previous vendor directory was from a time prior to Go modules
when Helm handled dependencies differently. It was no longer needed.

Signed-off-by: Matt Farina <matt.farina@suse.com>
(cherry picked from commit 5727f56a96)
2024-12-28 12:06:27 -05:00
George Jenkins
c40cf00a06 Shadow ORAS remote.Client interface
Signed-off-by: George Jenkins <gvjenkins@gmail.com>
2024-12-06 18:37:56 -05:00
Matt Farina
3fe0bbdd44
Merge pull request #13480 from rynowak/rynowak/override-authorizer
Make the authorizer and registry authorizer configurable
2024-12-02 20:54:13 +01:00
Ryan Nowak
3c2ab91263 Make the authorizer and registry authorizer configurable
Fixes: #12584

This change makes the authorizer and registryAuthorizer of the registry client configurable via options. This allows Go SDK users to override the authentication behavior of the client.

This PR makes both the authorizer and registryAuthorizer configurable because depending on the exact scenario that may be needed. The default registryAuthorizer only supports a specific implementation of the authorizer.

Signed-off-by: Ryan Nowak <nowakra@gmail.com>
2024-11-22 14:17:00 -08:00
Evans Mungai
bdaa93b969
Ensure test fails without causing panic
Signed-off-by: Evans Mungai <mbuevans@gmail.com>
2024-10-22 18:50:23 +01:00
Evans Mungai
3c4d0bb061
Fix failing tests
Signed-off-by: Evans Mungai <mbuevans@gmail.com>
2024-10-22 18:38:58 +01:00
Evans Mungai
323f88950a
Merge remote-tracking branch 'origin/main' into em/password-to-oci-registries 2024-10-22 17:54:10 +01:00
Nathan Baulch
ef85fa7f2d
Grammar fixes
Signed-off-by: Nathan Baulch <nathan.baulch@gmail.com>
2024-09-14 10:30:31 +10:00
Sidharth Menon
b0603fb042 fix: respect proxy envvars on helm install/upgrade
Signed-off-by: Sidharth Menon <menon.sid.k@gmail.com>
2024-06-15 15:04:37 -04:00
Evans Mungai
76c0f297c1
Merge remote-tracking branch 'origin/main' into em/password-to-oci-registries 2024-05-01 18:27:45 +01:00
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
Evans Mungai
dc158f6208
fix(helm): pass down username/password CLI parameters to OCI registry clients
When username/password parameters are passed in via the CLI
they are not passed down to the client handling requests to
OCI registries. This change ensures this happens

Signed-off-by: Evans Mungai <mbuevans@gmail.com>
2024-02-05 14:02:15 +00: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