Commit graph

66 commits

Author SHA1 Message Date
Jakub Warczarek
553f1e34f5 Add test for User-Agent header setting and refactor
Signed-off-by: Jakub Warczarek <jakub.warczarek@gmail.com>
2023-01-03 23:13:11 +01: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
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
Matthias Fehr
cab1fc87d4 Dont modify provided transport
Signed-off-by: Matthias Fehr <matthias@monostream.com>
2022-02-22 17:54:10 +01:00
Matthias Fehr
7d22040e66 Pass http getter as pointer in tests
Signed-off-by: Matthias Fehr <matthias@monostream.com>
2022-02-22 16:00:38 +01:00
Matthias Fehr
2acda0cc5b Add docs block
Signed-off-by: Matthias Fehr <matthias@monostream.com>
2022-02-22 15:59:53 +01:00
Matthias Fehr
45367ca9bf Add transport option and tests
Signed-off-by: Matthias Fehr <matthias@monostream.com>
2022-02-22 15:34:29 +01:00
Matthias Fehr
aa33f4fdd8 Reuse http transport
Signed-off-by: Matthias Fehr <matthias@monostream.com>
2022-01-17 15:12:21 +01: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
Scott Rigby
4d50526a2b
Move OCI tag semver range logic from OCIGetter to ChartDownloader
Signed-off-by: Scott Rigby <scott@r6by.com>
2022-01-12 14:36:54 -05:00
Scott Rigby
b6bf3905f3
Implement reusable GetTagMatchingVersionOrConstraint
Largely borrowed from (IndexFile).Get. However there is not currently a nice
way to make this code also usable to the repo package, as IndexFile depends on
a list of index Entries containing a nexted version.

We could refactor this later to somehow use the same shared function, but for
now keeping separate.

Signed-off-by: Scott Rigby <scott@r6by.com>
2022-01-11 21:47:04 -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
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
Josh Dolitsky
1809cc0509
Merge branch 'main' of github.com:helm/helm into hip-6
Signed-off-by: Josh Dolitsky <josh@dolit.ski>
2021-06-28 10:30:20 -04:00
longkai
0d9ebc7885 refactor(getter): refine http GET request
It just makes the code better, I suppose the following is rational:

- use standard libaray common constants instead of hardcode though it's
  really common
- close the response body even if the http status code is not 200 OK.
  The doc says *It is the caller's responsibility to close Body*.
- move the `bytes.Buffer` return value declaration where it gets used.

Signed-off-by: longkai <im.longkai@gmail.com>
2021-06-25 13:18:48 +08:00
Josh Dolitsky
cd27cf660f
Merge branch 'main' of github.com:helm/helm into hip-6
Signed-off-by: Josh Dolitsky <josh@dolit.ski>
2021-06-16 16:08:25 -04:00
Matt Farina
17ed9c4cd3
tweak basic handling
Signed-off-by: Matt Farina <matt.farina@suse.com>
2021-06-15 06:53:31 -04:00
Josh Dolitsky
00985cad6b
Implement changes proposed in HIP 6
For more information, please see the following URL:
https://github.com/helm/community/blob/main/hips/hip-0006.md

Note: OCI support remains experimental, and you are still
required to set HELM_EXPERIMENTAL_OCI=1 in your environment.

Signed-off-by: Josh Dolitsky <josh@dolit.ski>
2021-06-08 02:43:13 -04:00
Martin Hickey
699ea6dcef
Merge pull request #9066 from scaat/fix-specification
[FIX]Unified go specification
2021-06-02 11:55:53 +01: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
Alex Sears
1c377f8c62
add test to ensure OCIGetter registryClient is set
Signed-off-by: Alex Sears <me@alexsears.com>
2021-02-24 18:02:37 -05:00
Alex Sears
2d16a8135b
initialize registry client in oci getter
Signed-off-by: Alex Sears <me@alexsears.com>
2021-02-24 14:38:37 -05:00
Matt Farina
49f895db6b
Merge pull request #8843 from bloodorangeio/oci-pull
Signed-off-by: Matt Farina <matt@mattfarina.com>
2021-01-05 16:09:19 -05:00
Peter Engelbert
beda5e1e2b Address error on deletion of old dependencies
Signed-off-by: Peter Engelbert <pmengelbert@gmail.com>
2020-12-18 16:29:16 -06:00
Dinu Mathai
a202fb0c0b
Fixed bug - The flags --cert-file/--key-file where ignored when --insecure-skip-tls-verify flag is set (#9070)
* fix: Fixed bug - The flags --cert-file/--key-file where ignored when --insecure-skip-tls-verify flag is set

Signed-off-by: Dinu Mathai <Dinu.Mathai1@T-Mobile.com>

* fix: Added unit test

Signed-off-by: Dinu Mathai <Dinu.Mathai1@T-Mobile.com>
2020-12-17 13:49:16 -07: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
Scaat Feng
f1f2e6ff4c [FIX]comment should start with whitespace
Signed-off-by: Scaat Feng <scaat.feng@gmail.com>
2020-11-26 14:06:00 +08: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
Marc Khouzam
b18e7e201e chore(*): Fix formatting
Signed-off-by: Marc Khouzam <marc.khouzam@montreal.ca>
2020-05-14 10:12:11 -04:00
Hidde Beydals
ae738d7d87
feat(getter): add timeout option (#7950)
To allow finer grain control over the request when utilizing
`getter` as a package.

Signed-off-by: Hidde Beydals <hello@hidde.co>
2020-05-13 16:51:32 -05:00
Idan Elhalwani
93b0eee0df Set DisableCompression to true to disable unwanted httpclient transformation
Signed-off-by: Idan Elhalwani <idan@elhalwani.com>
2020-05-07 12:37:52 +03:00
Adam Reese
4a0dfbe53b
fix(pkg/cli): ensure correct configuration from kubeconfig file
Bind Helm flags to Kubernetes configuration loader to get a merged
config with kubeconfig.

Fixes: #7539

Signed-off-by: Adam Reese <adam@reese.io>
2020-04-23 12:20:14 -07:00
Matthias Riegler
dc26128fb4
Add --insecure-skip-tls-verify for repositories (#7254)
* added --insecure-skip-tls-verify for chart repos

Signed-off-by: Matthias Riegler <me@xvzf.tech>

* fixed not passing the insecureSkipTLSverify option

Signed-off-by: Matthias Riegler <me@xvzf.tech>

* fixed testcase

Signed-off-by: Matthias Riegler <me@xvzf.tech>

* pass proxy when using insecureSkipVerify

Signed-off-by: Matthias Riegler <me@xvzf.tech>

* Add testcases for insecureSkipVerifyTLS

Signed-off-by: Matthias Riegler <me@xvzf.tech>

* added missing err check

Signed-off-by: Matthias Riegler <me@xvzf.tech>

* panic after json marshal fails

Signed-off-by: Matthias Riegler <me@xvzf.tech>
2020-03-03 17:52:33 -06:00
LongKB
1d79ed2c18
Fix some spelling errors in comment (#7492)
Although it is spelling mistakes, it might make an affects while reading.

Signed-off-by: Kim Bao Long <longkb@vn.fujitsu.com>
2020-01-30 11:19:10 +00:00
Josh Soref
02ad2b1187 Spelling (#7258)
* spelling: constraint

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

* spelling: cryptographic

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

* spelling: dependency

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

* spelling: doesnot

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

* spelling: don't

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

* spelling: unexpected

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

* spelling: dreadnought

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

* spelling: default

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

* spelling: envvars

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

* spelling: evaluates

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

* spelling: execute

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

* spelling: extractor

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

* spelling: frobnitz

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

* spelling: generated

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

* spelling: implementation

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

* spelling: jabba

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

* spelling: keywords

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

* spelling: kubernetes

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

* spelling: override

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

* spelling: package

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

* spelling: parsable

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

* spelling: progress

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

* spelling: recursively

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

* spelling: release

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

* spelling: cache

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

* spelling: representing

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

* spelling: serializer

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

* spelling: subchart

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

* spelling: utilities

Signed-off-by: Josh Soref <jsoref@users.noreply.github.com>
2019-12-18 12:04:08 +00:00
Matthew Fisher
aa6104e442
fix(tlsutil): accept only a CA certificate for validation
Signed-off-by: Matthew Fisher <matt.fisher@microsoft.com>
2019-11-08 07:36:24 -08:00
Matthew Fisher
c9b127c3ee
fix(getter): set up TLS options during .Get()
Signed-off-by: Matthew Fisher <matt.fisher@microsoft.com>
2019-11-01 15:54:53 -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
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
Matt Farina
e9a704278b
Updating the httpgetter to use the new user agent function
Signed-off-by: Matt Farina <matt@mattfarina.com>
2019-08-12 11:41:06 -04: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
Matthew Fisher
806921dcee
feat(getter): set default User-Agent
Signed-off-by: Matthew Fisher <matt.fisher@microsoft.com>
2019-08-09 11:20:25 -07:00
Matthew Fisher
c728611e5a
feat(cli): support XDG base directory specification
Signed-off-by: Matthew Fisher <matt.fisher@microsoft.com>
2019-08-02 13:15:03 -07:00
Matthew Fisher
6e60242a18
ref(getter): change NewHTTPGetter and NewPluginGetter to return type Getter
Signed-off-by: Matthew Fisher <matt.fisher@microsoft.com>
2019-07-18 09:07:03 -07:00
Matthew Fisher
2800c56f9d
ref(downloader): pass in options to ChartDownloader
This restores the ability to pass in parameters at runtime to the
ChartDownloader, enabling users to pass in parameters like the --username
and --password flags.

Signed-off-by: Matthew Fisher <matt.fisher@microsoft.com>
2019-07-18 09:00:08 -07:00
steven-sheehy
1064934105 Add sub-command support to plugin downloader
Signed-off-by: steven-sheehy <steven@steven-laptop.local>
2019-07-14 17:36:51 -05:00
Matthew Fisher
e410a03c74
ref(getter): introduce Options for passing in getter parameters
instead of hard-coding the parameters being passed in the constructor, we should pass in an Options struct that can be used to pass in those parameters.

Signed-off-by: Matthew Fisher <matt.fisher@microsoft.com>
2019-07-02 15:22:23 -07:00
Matthew Fisher
7353a65bfa
ref(downloader): remove ResolveChartVersionAndGetRepo
Signed-off-by: Matthew Fisher <matt.fisher@microsoft.com>
2019-06-07 08:51: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