Commit graph

132 commits

Author SHA1 Message Date
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
Arvid E. Picciani
b9f347a574 fixes #11142 missing array length check on release
Signed-off-by: Arvid E. Picciani <arvid@kraud.cloud>
2022-07-13 11:26:04 +02:00
Timofey Kirillov
da8e7d2532
fix: "... has no deployed releases" error when release history contains only failed releases and history limit reached
Fixed old releases rotation procedure to not require a deployed release to exists.

An error will arise when there are no successfully deployed release yet, but releases history limit has been reached. In such situation helm will refuse to upgrade release anymore with "... has no deployed releases" error.

Furthermore, release rotation procedure already expecting lastDeployedRelease to be either nil, or not nil. So it is assumed that deployed release may exist or may not and these both outcomes were already expected as a valid situation rather than a failure.

Reworked storage_test.go TestStorageRemoveLeastRecentWithError test case: use mocked driver and test release creation procedure does not shadows errors from the underneath release rotation procedure.

Signed-off-by: Timofey Kirillov <timofey.kirillov@flant.com>
2022-03-31 10:22:42 +03:00
longkai
2deb641efd fix(typo): fix typo of storage doc
Signed-off-by: longkai <im.longkai@gmail.com>
2021-07-22 23:32:06 +08:00
Martin Hickey
ed7b6c4761
Merge pull request #8470 from mikeshng/sql-query-fix
fix(sql storage): Query() should return ErrReleaseNotFound immediately when no records are found
2021-06-09 14:23:53 +01:00
Adam Reese
db2aa1a8d6
fix(ci) update ci to use main branch
Signed-off-by: Adam Reese <adam@reese.io>
2021-04-01 11:26:44 -07: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
Daniel Lipovetsky
00cf10d360
fix(pkg/storage): If storage.Create fails to clean up recent release versions, return an error
Previously, storage.Create was ignoring the error. This meant that a user that
relied on the recent release version cleanup would not be notified if that
cleanup failed, and release versions could grow without bound.

Closes #9145

Signed-off-by: Daniel Lipovetsky <dlipovetsky@d2iq.com>
2020-12-18 15:10:01 -08:00
Daniel Lipovetsky
8c28da6567
test(pkg/storage): Verify that storage.Create returns an error if it fails to clean up least-recent release versions
Signed-off-by: Daniel Lipovetsky <dlipovetsky@d2iq.com>
2020-12-18 15:10:01 -08:00
Mike Ng
3be333b73b keep existing behavior of returning ErrReleaseNotFound when release(s) failed to decode
Signed-off-by: Mike Ng <ming@redhat.com>
2020-09-23 12:55:38 -04:00
Dmitry Chepurovskiy
09172b468a
Fix linting issues
Signed-off-by: Dmitry Chepurovskiy <dm3ch@dm3ch.net>
2020-08-04 18:18:50 +03:00
Dmitry Chepurovskiy
357a0785bc
Added selector filtering
Signed-off-by: Dmitry Chepurovskiy <dm3ch@dm3ch.net>
2020-08-04 18:18:50 +03:00
Dmitry Chepurovskiy
99bd709530
Pass labels from secret/configmap to release object
Signed-off-by: Dmitry Chepurovskiy <dm3ch@dm3ch.net>
2020-08-04 18:18:50 +03:00
Haoming Zhang
b6bbf34097
Close gzip reader when done.
Signed-off-by: Haoming Zhang <feicun1006@gmail.com>
2020-07-23 21:04:18 -07:00
Mike Ng
b86105aebc fix(sql storage): Query() should return ErrReleaseNotFound immediately when no records are found
Signed-off-by: Mike Ng <ming@redhat.com>
2020-07-16 13:58:14 -04:00
zouyu
c6a00e63ef Fix some go-lint warnings
Signed-off-by: zouyu <zouy.fnst@cn.fujitsu.com>
2020-06-29 16:36:27 +08:00
Matthew Morrissette
1911870958
fix(helm): allow a previously failed release to be upgraded (#7653)
Signed-off-by: Matt Morrissette <yinzara@gmail.com>
2020-04-17 11:56:29 -06:00
Elliot Maincourt
21d2aa7f2b
Migrate SQL storage driver to Helm 3 (#7635)
* Migrate SQL storage driver to Helm 3

Signed-off-by: Elliot Maincourt <e.maincourt@gmail.com>

* Update pkg/storage/driver/sql.go

Co-Authored-By: Sebastian Pöhn <sebastian.poehn@gmail.com>
Signed-off-by: Elliot Maincourt <e.maincourt@gmail.com>

* Add authentication to releases_v3

Signed-off-by: Elliot Maincourt <e.maincourt@gmail.com>

* Fix migration

Signed-off-by: Elliot Maincourt <e.maincourt@gmail.com>

* Template the init migration

Signed-off-by: Elliot Maincourt <e.maincourt@gmail.com>

* Prevent potential SQL injection

Signed-off-by: Elliot Maincourt <e.maincourt@gmail.com>

* Use an SQL querybuilder

Signed-off-by: Elliot Maincourt <e.maincourt@gmail.com>

* Remove references to HELM_DRIVER_SQL_DIALECT

Signed-off-by: Elliot Maincourt <e.maincourt@gmail.com>

Co-authored-by: Sebastian Pöhn <sebastian.poehn@gmail.com>
Co-authored-by: Matt Butcher <matt.butcher@microsoft.com>
2020-04-16 14:53:40 -06:00
Matt Farina
a3fa01ff8b
Merge pull request #7640 from yinzara/bugfix/issue-7002
fix(helm): stdin values for helm upgrade --install
2020-04-15 13:16:36 -04:00
Adam Reese
e1d046bc43
fix(tests): fix broken unit tests in storage (#7928) 2020-04-14 21:34:08 -07:00
Lu Fengqi
9e1f381bf2
Add unit test for Secrets/ConfigMaps (#7765)
* test(pkg/storage/secrets): make MockSecretsInterface.List follow ListOptions

Signed-off-by: Lu Fengqi <lufq.fnst@cn.fujitsu.com>

* test(pkg/storage/secrets): add unit test for Secrets.Query

Signed-off-by: Lu Fengqi <lufq.fnst@cn.fujitsu.com>

* test(pkg/storage/cfgmaps): make MockConfigMapsInterface.List follow ListOptions

Signed-off-by: Lu Fengqi <lufq.fnst@cn.fujitsu.com>

* test(pkg/storage/cfgmaps): add unit test for ConfigMaps.Query

Signed-off-by: Lu Fengqi <lufq.fnst@cn.fujitsu.com>
2020-04-14 20:07:02 -06:00
Eric Bailey
b9445616b5
fix(storage): preserve last deployed revision (#7806)
Signed-off-by: Eric Bailey <eric@ericb.me>
2020-04-13 12:57:30 -06:00
Adam Reese
c2da4fd53d
ref(*): kubernetes v1.18 (#7831)
Upgrade Kubernetes libraries to v0.18.0

Add new lazy load KubernetesClientSet to avoid missing kubeconfig error

In kubernetes v1.18 kubeconfig validation was added.  Minikube and Kind
both remove kubeconfig when stopping clusters.  This causes and error
when running any helm commands because we initialize the client before
executing the command.

Signed-off-by: Adam Reese <adam@reese.io>
2020-04-13 08:40:38 -07:00
tiendc
26830942d2
Fix a bug in Delete() in storage/driver/cfgmaps.go (#7367) 2020-03-13 11:36:14 -07:00
tiendc
06bc18c624
Fix a bug in storage/driver/secrets.go Delete() (#7348)
* Fix a bug in storage/driver/secrets.go
2020-03-13 11:35:39 -07:00
Zhou Hao
f5da6bd3d6 add unit test for RecordsReplace
Signed-off-by: Zhou Hao <zhouhao@cn.fujitsu.com>
2020-03-02 14:32:57 +08:00
Zhou Hao
ae508ebd1c add unit test for ConfigMapDelete
Signed-off-by: Zhou Hao <zhouhao@cn.fujitsu.com>
2020-03-02 14:14:04 +08:00
Zhou Hao
95d7f36d41 add unit test for SecretDelete
Signed-off-by: Zhou Hao <zhouhao@cn.fujitsu.com>
2020-03-02 13:39:58 +08:00
Matt Morrissette
1ab52fa79c
fix(helm): stdin values for helm upgrade --install
Signed-off-by: Matt Morrissette <yinzara@gmail.com>
2020-02-27 11:07:02 -05:00
Zhou Hao
f1f661d4ca pkg/storage/records: add unit test for Exists
Signed-off-by: Zhou Hao <zhouhao@cn.fujitsu.com>
2020-02-24 11:53:04 +08:00
Zhou Hao
c96aff6a43 pkg/storage/records: add unit test for Index
Signed-off-by: Zhou Hao <zhouhao@cn.fujitsu.com>
2020-02-24 11:42:04 +08:00
Zhou Hao
6b1eebd23a pkg/storage/records: add unit test for Get
Signed-off-by: Zhou Hao <zhouhao@cn.fujitsu.com>
2020-02-24 11:28:14 +08:00
Matthew Fisher
8e1fc4bc6f
fix(memory_test): rebase master
Signed-off-by: Matthew Fisher <matt.fisher@microsoft.com>
2020-02-07 09:25:23 -08:00
Marc Khouzam
e6d2d10bad fix(tests): Add namespace support to memory driver
Signed-off-by: Marc Khouzam <marc.khouzam@montreal.ca>
2020-02-07 11:41:47 -05:00
Matthew Fisher
98962dce3f
Merge pull request #7349 from tiendc/unit_test_memory_list
Add unit test for List() of pkg/storage/driver/memory.go
2020-02-07 08:30:39 -08:00
Matt Farina
e3675e3312
Merge pull request #7358 from cristiklein/fix/deal-with-correupted-storage-v3
fix(helm): improve handling of corrupted storage
2020-01-22 12:37:18 -05:00
Martin Hickey
88f42929d7
Remove references to protobuf (#7425)
Remove references to protobuf and update description of release
object stored representation to Helm v3.

Signed-off-by: Martin Hickey <martin.hickey@ie.ibm.com>
2020-01-17 15:56:56 +00:00
Cristian Klein
1f0582cadc fix(helm): improve handling of corrupted storage
Helm does not yet properly handle concurrent executions (see #7322),
and invoking Helm concurrently on the same release lead to corrupted storage.
Specifically, several Releases may be marked as DEPLOYED. This patch improved handling of such situations, by taking the latest
DEPLOYED Release. Eventually, the storage will clean itself out, after
the corrupted Releases are deleted due to --history-max.

This is a port to Helm v3 of #7319.

Signed-off-by: Cristian Klein <cristian.klein@elastisys.com>
2020-01-16 08:55:25 +01:00
Simon Alling
e868cb23c0 ref(pkg/storage): Refactor Deployed and DeployedAll (#7374)
The error returned from DeployedAll will never contain "not found".

The error returned at the end of Deployed is already known to be nil,
and we never want to return ls[0] together with a non-nil error anyway.

Signed-off-by: Simon Alling <alling.simon@gmail.com>
2020-01-15 15:51:04 +00:00
Hu Shuai
de9118b879 Fix a typo "update" -> "updates" (#7346)
Signed-off-by: Hu Shuai <hus.fnst@cn.fujitsu.com>
2020-01-08 09:19:00 +00:00
Dao Cong Tien
476ffaea8c Add unit test for List() of pkg/storage/driver/memory.go
Signed-off-by: Dao Cong Tien <tiendc@vn.fujitsu.com>
2020-01-08 15:43:57 +07: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
Karuppiah Natarajan
bfd8250803 fix list not showing multiple releases with same name in different namespaces (#6756)
Signed-off-by: Karuppiah Natarajan <karuppiah7890@gmail.com>
2019-10-24 14:34:48 +01: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
Martin Hickey
caa26c4bb2
Change release storage name to use helm storage type as prefix (#6500)
* Change release storage name to prefix helm storage type

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

* Add comments about the Kubernetes storage object type field content

Signed-off-by: Martin Hickey <martin.hickey@ie.ibm.com>
2019-09-26 17:46:19 +01:00
Adam Reese
b2d5e41fc7
ref(*): remove dead code
Signed-off-by: Adam Reese <adam@reese.io>
2019-08-19 10:22: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
Matthew Fisher
2571dbf82f
ref: remove pkg/helm, pkg/hapi, pkg/tiller
Signed-off-by: Matthew Fisher <matt.fisher@microsoft.com>
2019-03-12 09:47:12 -07: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