helm/pkg/tiller
Cristian Klein 5f66676300
fix(tiller): Avoid corrupting storage via a lock
If two `helm upgrade`s are executed at the exact same time, then one of
the invocations will fail with "already exists".

If one `helm upgrade` is executed and a second one is started while the
first is in `pending-upgrade`, then the second invocation will create a
new release. Effectively, two helm invocations will simultaneously
change the state of Kubernetes resources -- which is scary -- then two
releases will be in `deployed` state -- which can cause other issues.

This commit fixes the corrupted storage problem, by introducting a poor
person's lock. If the last release is in a pending state, then helm will
abort. If the last release is in a pending state, due to a previously
killed helm, then the user is expected to do `helm rollback`.

This is a port to Helm v2 of #7322.

Signed-off-by: Cristian Klein <cristian.klein@elastisys.com>
(cherry picked from commit c32c9a510b)
2020-08-12 16:13:08 -04:00
..
environment change GetPodLogs to return io.Reader instead of string 2019-10-08 13:31:14 -07:00
hook_sorter.go change copyright to "Copyright The Helm Authors" 2018-07-30 08:29:17 -07:00
hook_sorter_test.go change copyright to "Copyright The Helm Authors" 2018-07-30 08:29:17 -07:00
hooks.go fix wrong spells in hooks.go 2019-08-06 10:18:37 +08:00
hooks_test.go fix(helm): Delete hooks should wait for resource to be removed from etcd before continuing 2019-06-20 11:56:31 -07:00
kind_sorter.go Networkpolicy kind sort (#6266) 2019-08-26 10:43:07 +01:00
kind_sorter_test.go Networkpolicy kind sort (#6266) 2019-08-26 10:43:07 +01:00
release_content.go change copyright to "Copyright The Helm Authors" 2018-07-30 08:29:17 -07:00
release_content_test.go change copyright to "Copyright The Helm Authors" 2018-07-30 08:29:17 -07:00
release_history.go change copyright to "Copyright The Helm Authors" 2018-07-30 08:29:17 -07:00
release_history_test.go change copyright to "Copyright The Helm Authors" 2018-07-30 08:29:17 -07:00
release_install.go Merge branch 'master' into 2751 2018-11-01 15:02:17 -04:00
release_install_test.go Updating to newer versions of dependencies 2019-09-18 12:49:06 -04:00
release_list.go fix-up typo (#6501) 2019-09-25 14:10:51 +01:00
release_list_test.go Fix race condition in `helm list` (#4620) 2018-09-10 11:14:03 -07:00
release_modules.go Fix `no RESOURCE with the name NAME found` 2019-03-22 21:15:00 +03:00
release_rollback.go fix(tiller): rollback deleted release (#3722) (#4820) 2018-11-12 12:36:58 +01:00
release_rollback_test.go fix(tiller): rollback deleted release (#3722) (#4820) 2018-11-12 12:36:58 +01:00
release_server.go fix(tiller): Avoid corrupting storage via a lock 2020-08-12 16:13:08 -04:00
release_server_test.go change GetPodLogs to return io.Reader instead of string 2019-10-08 13:31:14 -07:00
release_status.go change copyright to "Copyright The Helm Authors" 2018-07-30 08:29:17 -07:00
release_status_test.go change copyright to "Copyright The Helm Authors" 2018-07-30 08:29:17 -07:00
release_testing.go TEST: add option to dump logs during helm test 2019-10-08 13:30:45 -07:00
release_testing_test.go change copyright to "Copyright The Helm Authors" 2018-07-30 08:29:17 -07:00
release_uninstall.go change copyright to "Copyright The Helm Authors" 2018-07-30 08:29:17 -07:00
release_uninstall_test.go test(resource-policy): verify behavior of non-standard policy types 2019-03-04 10:17:43 -05:00
release_update.go fix(tiller): Avoid corrupting storage via a lock 2020-08-12 16:13:08 -04:00
release_update_test.go fix(tiller): Avoid corrupting storage via a lock 2020-08-12 16:13:08 -04:00
release_version.go change copyright to "Copyright The Helm Authors" 2018-07-30 08:29:17 -07:00
resource_policy.go feat(resource-policy): delete manifests when policy value is delete 2019-03-04 10:09:48 -05:00
server.go change copyright to "Copyright The Helm Authors" 2018-07-30 08:29:17 -07:00