Commit Graph

199 Commits

Author SHA1 Message Date
Matthew Fisher 8d408876a0
Fix race condition in `helm list` (#4620)
* Fix race in helm list when partitioning

Problem:
The chunks slice that is passed through the channel is reused for each
partition. This means that encoding the release into a message is racing with
populating the next partition, causing the results to sometimes not fit in the
message, and the release list to be incorrect

Solution:
Allocate a new slice for each partition

Issue #3322

Signed-off-by: Brian Marshall <bmarshall13@users.noreply.github.com>
(cherry picked from commit a0858e29d8)

* fix import sorting

Signed-off-by: Matthew Fisher <matt.fisher@microsoft.com>

* ref(release_server_test): use NewReleaseServer()

Signed-off-by: Matthew Fisher <matt.fisher@microsoft.com>

* add unit test for race condition in `helm list`

Signed-off-by: Matthew Fisher <matt.fisher@microsoft.com>
(cherry picked from commit 5b23632446)
2018-09-10 11:19:58 -07:00
Matthew Fisher 941b1f4d68
fix(release_server): handle the case when requested values is empty (#4604)
Signed-off-by: Matthew Fisher <matt.fisher@microsoft.com>
2018-09-07 12:22:12 -07:00
Arash Deshmeh 380ca1a923 feat(helm): add ability to sort release list by chart name
Signed-off-by: Arash Deshmeh <adeshmeh@ca.ibm.com>
2018-09-01 05:40:07 -04:00
Matthew Fisher faa921dd7c
Merge pull request #4358 from novas0x2a/fake-improvements
Flesh out the fake client even more
2018-08-31 17:09:23 -07:00
Adam Reese efadbd8803
ref(*): kubernetes v1.11 support 2018-08-09 19:13:12 -07:00
Michelle Noorali 2d82b88282
Merge pull request #4364 from michelleN/fix-4337
fix(release_server): fix how we merge values
2018-08-07 17:13:31 -04:00
Michelle Noorali 3e0de0dae9 fix(release_server): fix how we merge values
resolves #4337
Merging maps inside of strings gets a bit tricky. When two
strings consisting of "{}" were being added together, this resulted in
"{}\n{}" instead of "{}" which is what we wanted. This led to YAML
parsing errors and showed up when the `--reuse-values` flag was used
when no overrides via `--set` were provided during install and/or
upgrade.
2018-08-07 16:23:17 -04:00
Mike Lundy 67de9f2be4 [tiller] move the Manifest type to its own pkg
It's really easy to cause an import cycle on this type; this resolves
the problem by moving it out of the tiller pkg into its own. An alias is
left behind in order to prevent downstream breakage.
2018-08-06 17:24:02 -07:00
Matthew Fisher 25a1cff317
Merge pull request #4402 from novas0x2a/force-obey-dryrun
fix(tiller): make update --force --dry-run obey dry-run
2018-07-31 09:10:25 -07:00
Mike Lundy 0736022d98 [tiller] make update --force --dry-run obey dry-run 2018-07-30 14:18:00 -07:00
Matthew Fisher 2d77db11fa change copyright to "Copyright The Helm Authors" 2018-07-30 08:29:17 -07:00
Matthew Fisher 50ebdd808d
Merge pull request #3825 from adshmh/3581-feat-allow-custom-desc-after-helm-release-upgrade
Feature: allow custom description after helm release upgrade
2018-07-10 07:43:36 -07:00
Matthew Fisher a660b18987
Merge pull request #4135 from mattjmcnaughton/mattjmcnaughton/4086-fix-concurrency-issues-with-helm-install
Fix concurrency issues with helm install
2018-06-11 16:06:27 -07:00
Arash Deshmeh a32868e48b added ability to handle custom release descriptions to tiller
Signed-off-by: Arash Deshmeh <adeshmeh@ca.ibm.com>
2018-06-05 17:15:56 -04:00
mattjmcnaughton ddd1f48c40 Increase error message specificity for name reuse
If `helm upgrade` fails because a reused name is still in use, the error
message does not specify which name is still in use. Update the error
message.
2018-06-05 09:48:11 -04:00
mattjmcnaughton 53c8e9b67e Fix concurrency issues with helm install
Address a race condition that arises when running two `helm install`
commands, both of which specify a namespace that does not already exist.

In this specific instance, attempting to create a `namespace` which
already exists shouldn't be a failure which causes `helm install` to
terminate.
2018-05-29 09:39:27 -04:00
Matt Butcher 0699ec4248
feat(tiller): support CRD installation (#3982)
This adds support for installing CRDs well before any other resource
kinds are installed.

This PR introduces a new hook, `crd-install`, that fires before
manifests are even validated. It is used to install a CRD before any
other part of a chart is installed.

Currently, this hook is _only implemented for install_. That means we
currently cannot add new CRDs during `helm upgrade`, nor can they
be rolled back. This is the safest configuration, as the update/rollback
cycle gets very challenging when CRDs are added and removed.
2018-05-11 12:09:38 -06:00
Sergii Manannikov 7631b8a926 Create PodSecurityPolicy before Pods and ServiceAccounts 2018-04-14 18:10:21 +02:00
Arash Deshmeh c22492ff01 fix(helm): refactor tiller release install unit tests using chart and install request stubs
Signed-off-by: Arash Deshmeh <adeshmeh@ca.ibm.com>
2018-04-09 12:20:05 -04:00
Nikhil Manchanda b687e9e879
Merge pull request #3709 from adshmh/fix-output-leak-of-tiller-release-install-test
fix output leak from tiller release install test
2018-04-06 15:42:38 -07:00
Taylor Thomas 2a86164c1d
Merge pull request #3829 from stuartleeks/set-rollback-failure
Fix: Failed rollback left in PENDING_ROLLBACK state
2018-04-06 12:23:11 -07:00
Michelle Noorali 72d54f356d
Merge pull request #3831 from michelleN/fix-3655
fix(pkg/tiller): saves all previous computed values on reuseValues
2018-04-04 18:20:13 -04:00
Michelle Noorali e02802ba95 ref(pkg/tiller): clarify reuseValues comment 2018-04-04 16:13:07 -04:00
Michelle Noorali 9266731dc4 fix(pkg/tiller): reuseValues combines all prev val
Resolves #3655
We were seeing that when running helm upgrade with the reuse-values
flag enabled that you could end up in the position where overrides
a.k.a computed values from previous revisions were not being saved on
the updated revision. This left us in a weird position where some
computed values would disappear mysteriously in the abyss. That
happened because computed values from previous revisions weren't merged
with the new computed values every time the reuse-values flag was used.
This PR merges computed values from the previous revisions so you don't
end up in that kind of conundrum.
2018-04-04 16:05:51 -04:00
Stuart Leeks bac4f45f94 Switch flag to update existing record 2018-04-04 09:18:17 +01:00
Matthew Fisher e794c48c3a
Merge pull request #3540 from flant/hook_recreate_delete_policy
Implement before-hook-creation delete policy
2018-04-03 11:09:16 -07:00
Timofey Kirillov b7fe0d0bd7 Add hook-delete-policy ReleaseServer unit tests
Cover hook-succeeded, hook-failed and before-hook-creation hook delete policies.
2018-04-03 17:55:44 +03:00
fibonacci1729 ad99c1b749 release list paritioning 2018-04-02 15:43:47 -06:00
fibonacci1729 2dd9b34d28 stream releases when listing 2018-03-28 15:43:31 -06:00
Alexey igrychev 1d4883bf3c Implement before-hook-creation delete policy
Existing helm.sh/hook-delete-policy annotation variables (hook-failed, hook-succeeded) do not allow to leave failed jobs for debugging without blocking the next job launching: every failed job must be deleted manually before the next related release is launching (installing, updating or rolling back).

New policy, before-hook-creation, removes the hook from previous release if there is one before the new hook is launched and can be used with another variable.
2018-03-21 18:13:53 +03:00
Arash Deshmeh a43ddcc191 fix output leak from tiller release install test
Signed-off-by: Arash Deshmeh <adeshmeh@ca.ibm.com>
2018-03-18 20:42:05 -04: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
Matthew Fisher 1a9e0f0d15
Merge pull request #3535 from adshmh/fix-output-leak-from-pkg-tiller-tests
fix the output leak from test code under pkg/tiller
2018-02-27 18:22:05 +00:00
Arash Deshmeh 5b25eef9e2 fix(helm): fix the bug in test code under pkg/tiller that leaks output to stdout during build
Signed-off-by: Arash Deshmeh <adeshmeh@ca.ibm.com>
2018-02-19 12:57:30 -05:00
Johnny Bergström 98e5006ecf Bump client side grpc max msg size
Set it to match the server side, or the default limit
of 4MB will still apply when upgrading charts.

Fixes #3512
2018-02-19 17:04:41 +01:00
Matt Farina 614cd9dfe7
fix(grpc): Fixes issue where message sending limited to 4mb
Between grpc 1.2.x and 1.7.x there was an API change. The
previous MaxMsgSize is now a wrapper around MaxRecvMsgSize. This
change now sets the MaxRecvMsgSize and MaxSendMsgSize which need
to be set independently.
2018-02-07 12:00:13 -05:00
xuhaigang 61623bfe2d feat(tiller/proto):Allow charts to specify k8s compatibility in semver field
Add an optional field kubeVersion to Chart.yaml that allows the chart
developer to specify a semver compliant version.

Closes #2708, #2706
2018-01-06 10:02:09 +08:00
Adam Reese a31e3b8fe1
ref(*): kubernetes v1.9 support (#3234) 2018-01-05 12:30:26 -08:00
Taylor Thomas 04769b7c26
Merge pull request #3131 from fgimenez/fix-2745
check if resource is present before adding it to remaining or keep on deletion
2017-11-30 18:10:00 -08:00
Federico Gimenez a607fe798d iinitialize message only when at least one manifest is kept 2017-11-30 08:49:48 +01:00
Federico Gimenez 93bce130fb fix signatures 2017-11-29 14:18:12 +01:00
Federico Gimenez 81eaf2f263 only check existence for the possibly kept manifests 2017-11-29 14:14:50 +01:00
Hadrien Chauvin 838d780894 update google.golang.org/grpc to 1.7.2 (#3101) 2017-11-22 09:16:02 -07:00
Federico Gimenez e6d907ed28 check if resource is present before adding it to remaining or keep on deletion 2017-11-12 11:20:52 +01: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
Taylor Thomas 29c3b5276f fix(tiller): Adds CRD ordering
This adds CRD ordering into the explicit kind sorter list

Closes #2925
2017-10-09 23:21:44 -07:00
Matthew Fisher d4f5a133dd Merge pull request #2960 from HotelsDotCom/upgrade-failure-record-release-as-update
Correctly persists Release upgrade failure
2017-10-03 12:30:48 -07:00
Taylor Thomas f8e9741578 Merge pull request #2984 from thomastaylor312/feat/add_missing_test
fix(sorter): Adds missing unit test
2017-10-03 11:41:10 -07:00
Justin Scott b642ba2087 Merge pull request #2831 from jascott1/sort_unknown_kind
bug(tiller): sort unknown but different kinds alphabetically based on kind name
2017-10-02 13:13:04 -07:00