89 Commits
Author SHA1 Message Date
Cristian Klein 840e0e271d fix(tiller): improve handling of corrupted storage
For some reason, many users experince corrupted storage with the
ConfigMaps storage backend. Specifically, several Releases are 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.

Closes #6031

Signed-off-by: Cristian Klein <cristian.klein@elastisys.com>
2020-01-02 11:10:06 +01:00
Sakura 627283ac74 fix typo
Signed-off-by: Sakura <longfei.shang@daocloud.io>
2019-08-23 12:02:21 +08:00
AllenZMC b788e3dce9 fix word 'potgres' to 'postgres'
Signed-off-by: czm <zhongming.chang@daocloud.io>
2019-08-01 21:59:58 +08:00
ethan c086f78583 cleanup: error message typos in sql.go
Signed-off-by: ethan <guangming.wang@daocloud.io>
2019-07-26 02:20:46 +00:00
Matthew Fisher ae0d4b151b fix(pkg/storage/driver): use shallowReleaseEqual()
Signed-off-by: Matthew Fisher <matt.fisher@microsoft.com>
2019-05-09 14:55:17 -07:00
Matthew Fisher a93ebe17d6 Merge pull request #5371 from PayFit/feat/add-sql-storage-driver
[storage] Add an SQL storage driver
2019-05-09 12:03:14 -07:00
Morten Torkildsen 072cd6af37 fix(helm): Regenerate go types from proto
Signed-off-by: Morten Torkildsen <mortent@google.com>
2019-05-02 14:12:57 -07:00
Elliot Maincourt f4052821c9 Fix formatting issue
Signed-off-by: Elliot Maincourt <e.maincourt@gmail.com>
2019-04-22 13:14:13 +02:00
Elliot Maincourt 13e82d2039 Clarify our SQL Release binding struct naming and purpose
Signed-off-by: Elliot Maincourt <e.maincourt@gmail.com>
2019-04-22 13:14:13 +02:00
Étienne Lafarge 6c396880ad [pr-review] Lighten docs & validate SQL dialect
Signed-off-by: Étienne Lafarge <etienne.lafarge@gmail.com>
2019-04-22 13:14:13 +02:00
a602d70842 [storage] Add an SQL storage driver
This commits adds the possibility to back Tiller (or the future
Tiller-less Helm CLI) with any SQL database (only postgres has been
tested so far) to store release information.

The main motivation for this commit was to use a storage backend that
would allow releases larger that 1MB in size (ConfigMap or Secret
drivers don't, because of limits on value size in the underlying etcd
key-value store).

Signed-off-by: Étienne Lafarge <etienne.lafarge@gmail.com>

Co-authored-by: Elliot Maincourt <e.maincourt@gmail.com> (@emaincourt)
Co-authored-by: Paul Borensztein <hi@0x01.fr> (@commit-master)
2019-04-22 13:14:13 +02:00
JoeWrightss 9e18364fea Fix some spelling errors in comment (#5246)
Signed-off-by: zhoulin xie <zhoulin.xie@daocloud.io>
2019-01-31 21:33:04 -08:00
Henry Nash adce632c83 fix(helm): get rid of lint warning in pkg/storage (#5021)
Provide comment for constant to avoid golint warning.

Closes #5020

Signed-off-by: Henry Nash <henry.nash@uk.ibm.com>
2018-12-05 13:06:46 -08:00
Matt Tucker 5bf38a2d7d fix(storage): when pruning release versions, never delete the last deployed revision
Signed-off-by: Matt Tucker <ultimateboy@gmail.com>
2018-11-28 12:46:35 -07:00
Brent 9ae00bebad fix(tiller): rollback deleted release (#3722) (#4820)
Solves #3722 by making the changes in #3539 more compatible with the previous behavior.

This gives a recovery option for "oops I deleted my helm release" by allowing rollback, which is intended to be a working feature of helm. Note that purging releases removes the history required to rollback, so this doesn't work in that case. However, purging takes significantly more time, so it's harder to accidentally purge everything.

Signed-off-by: Brent <bmperrea@gmail.com>
2018-11-12 12:36:58 +01:00
Adam Reese dbf84cd229 ref(*): kubernetes v1.12 support
Signed-off-by: Adam Reese <adam@reese.io>
2018-10-04 10:28:34 -07:00
Fabian Ruff 37a731db79 Avoid importing k8s.io/kubernetes from pkg/helm (#4499)
* Avoid importing k8s.io/kubernetes from pkg/helm

When writing a helm client (e.g. a helm plugin) that talks to tiller importing k8s.io/helm/pkg/helm to get the grpc client is key.
This pkg should not have a dependency to the k8s.io/kubernetes to avoid pulling in a lot of code that is only used within tiller and blow up binary sizes.

Signed-off-by: Fabian Ruff <fabian@progra.de>

* Add references to pull request in errors message

Signed-off-by: Fabian Ruff <fabian@progra.de>

* copy helper function from pkg/storage/driver

Signed-off-by: Fabian Ruff <fabian@progra.de>

* Move storage errors to seperate package

Signed-off-by: Fabian Ruff <fabian@progra.de>

* Keep old  error variables for backward compatibility

Signed-off-by: Fabian Ruff <fabian@progra.de>
2018-09-04 11:19:33 -07:00
Matthew Fisher 2d77db11fa change copyright to "Copyright The Helm Authors" 2018-07-30 08:29:17 -07:00
liyongxin 63760b2937 typo fix for lengh to length 2018-06-08 10:09:07 +08:00
Matthew Fisher 13730b0dab replace FAILED deployments with helm upgrade --install --force
When using `helm upgrade --install`, if the first release fails, Helm will respond with an error saying that it cannot upgrade from an unknown state.

With this feature, `helm upgrade --install --force` automates the same process as `helm delete && helm install --replace`. It will mark the previous release as DELETED, delete any existing resources inside Kubernetes, then replace it as if it was a fresh install. It will then mark the FAILED release as SUPERSEDED.
2018-03-08 15:33:10 -08:00
Johnny Bergström 5f1a21bc32 fix(tiller): Supersede multiple deployments (#3539)
* add test for rolling back from a FAILED deployment

* Update naming of release variables

Use same naming as the rest of the file.

* Update rollback test

- Add logging
- Verify other release names not changed

* fix(tiller): Supersede multiple deployments

There are cases when multiple revisions of a release has been
marked with DEPLOYED status. This makes sure any previous deployment
will be set to SUPERSEDED when doing rollbacks.

Closes #2941 #3513 #3275
2018-02-27 10:25:40 -08:00
Adam Reese c314e2e2f1 fix(plugins): support newer git (#3571)
Newer gits don't like checking out an empty string.

```
empty string is not a valid pathspec. please use . instead if you meant to match all paths
```
2018-02-26 15:44:32 -08:00
Adam Reese a31e3b8fe1 ref(*): kubernetes v1.9 support (#3234) 2018-01-05 12:30:26 -08:00
Andrey Klimentyev cfb7dfa82c Typo fix 2017-12-18 13:34:58 +03:00
Adam Reese 82ef751414 fix(tiller): upgrade last deployed release
Fixes #2437

Two bugs were causing this behavior

- Tiller was marking the previous release superseded when an upgrade
failed.
- Upgrade was diffing against failed releases
2017-11-03 14:57:33 -07:00
Remington Reackhof 9af1018bd3 Add secrets storage backend for releases 2017-10-08 22:11:41 -04:00
Maxim Ivanov ff5acc9bd8 Make Memory driver to store copy of releases to stop hiding storage errors during tests 2017-09-26 15:32:49 +01:00
Matt Butcher 0853f4906a feat(tiller): limit number of versions stored per release
This adds a new configuration option to Tiller to limit the number of
records stored per release.

Tiller stores historical release information (helm history, helm
rollback). This makes it possible to set a maximum number of versions
per release.

To enable this feature, use `helm init --history-max NNN`. Note that
because of the restrictions on Deployment objects, you will have to
re-install Tiller to add a limit.

Along the way, I found an unreported bug in the Memory storage driver.
This fixes that bug and adds substantially more tests to catch
regressions.

Closes #2332
2017-08-10 12:01:20 -06:00
Justin Scott fa68a6e1db fix(tiller): remove locking system from storage and rely on backend controls
Tiller currently hangs indefinitely when deadlocks arise from certain
concurrent operations. This commit removes the nested mutex locking
system from pkg/Storage and relies on resource contention controls in k8s.

Closes #2560
2017-07-19 16:02:38 -07:00
Justin Scott af4c243ee3 Correct punctuation and capitalization for user facing strings. 2017-06-26 10:23:26 -07:00
Taylor Thomas 119fa6537c feat(tiller): Adds more logging
This builds on previous work and adds more logging to follow
the full process of installing, updating, deleting, and rolling back.
This also standardizes capitalization of logs and small formatting
fixes
2017-05-30 18:17:22 -07:00
Adam Reese 15254e4c5c feat(*): add generic logging interface (#2394)
Adds a generic logging interface to importable packages.
2017-05-19 11:43:04 -07:00
Maciej Kwiek ec92b76054 Release are locked to avoid parallel changes
Environment is supplied with release lock map which allows to lock a
release by name to make sure that update, rollback or uninstall aren't
running on one release at the same time.
2017-04-24 13:05:35 +02:00
Adam Reese 85c41ef11a ref(*): kubernetes v1.6
Rebase on kubernetes v1.6
2017-04-11 15:42:23 -07:00
Sushil Kumar 000bf9fd1a Added release-name to helm delete error
Fixes https://github.com/kubernetes/helm/issues/2251
In case a user tries to delete a non-existent release,
the error message displayed was missing release-name.
2017-04-11 09:41:07 -07:00
Adam Reese d4061b5b60 fix(tiller): enforce release name length on uninstall
If a selector is created from invalid values it will return nil.

Which is EVERYTHING!!!

closes: #2115
2017-03-15 14:10:44 -07:00
Larry Rensing 3a380923f4 feat(*): add --namespace flag to 'helm list'
Users can now specify a namespace filter for 'helm list'.  Only the
releases within the specified namespace will be shown.  For example,
'helm list --namespace foo' will only show releases for the 'foo'
namespace.  Also added a namespace field to the table view.

Closes #1563
2017-02-07 10:20:28 -06:00
Adam Reese 4418b1a20d ref(*): remove dead code
RIP
2017-01-04 23:45:47 -08:00
dongziming 34d7585f1e Spelling errors and so on. 2016-12-26 11:40:48 +08:00
Matt Butcher de7c5e5a38 feat(tiller): Add .Release.Revision and .IsUpgrade
New properties are available to template developers.

Closes #1554
2016-12-14 18:06:34 -07:00
Adam Reese 84ae1268e1 fix(*): import grouping 2016-12-13 09:57:05 -08:00
Adam Reese ea3be9e3b2 feat(*): migrate to kubernetes 1.5 2016-12-13 09:57:05 -08:00
Matt Butcher a5d96c2704 fix(tiller): fix spurious "no release found" errors.
There are some places where releases are only located if they are in the
state DEPLOYED. That particular logic was incorrectly used for upgrades.
That caused #1566. While fixing that issue, I found that this was also
the root cause of #1587 (though because it was off by one). I added a
generic method to get the last release, regardless of its status.

This allows some behaviors that previously failed:

- 'helm upgrade' can now be performed on a DELETED release
- 'helm rollback' can now be performed on a DELETED release even if
  there is only one revision of that release history.

Closes #1566
Closes #1587
2016-12-02 17:14:07 -07:00
Fabian Ruff eb4b78bbbe Add compression to configmap storage driver
This commit changes the configmap storage driver to compress
the serialized release before storing it as a base64 encoded string.
This change is backward compatible as it handles existing releases
gracefully by skipping the decompression step when the gzip magic
header is not present.
2016-10-20 20:04:28 +02:00
Matt Butcher a1f5955a65 fix(tiller): fix nil pointers in error messages
There were a few places where error messages were accessing properties
of objects that were nil because of the error.

Closes #1374
2016-10-17 17:01:56 -06:00
fibonacci1729 24fe8643de ref(*): add sorter/filter utilties to releaseutil 2016-10-12 11:46:17 -06:00
Adam Reese 150fb33c2e fix(*): prevent testing package from being imported
Prevent testing package from being imported into main application
2016-10-07 15:51:19 -07:00
fibonacci1729 e9dd302a9c feat(helm/cmd): support for retrieving release history 2016-10-05 17:53:55 -06:00
fibonacci1729 f77435e686 fix(helm-list): only list configmaps owned by TILLER 2016-09-15 16:05:17 -06:00
fibonacci1729 83df6ebc4d feat(rollback-storage): remove extraneous else block and fix type in records_test 2016-09-12 09:16:03 -06:00