Commit Graph

235 Commits

Author SHA1 Message Date
Morten Torkildsen bf377c5ad5
fix(helm): Only validate new manifests
Signed-off-by: Morten Torkildsen <mortent@google.com>
2019-06-05 13:48:54 -07:00
SataQiu 06fbc720e7 refactor: using tiller probe port constant
Signed-off-by: SataQiu <qiushida@beyondcent.com>
2019-04-18 14:19:40 +08:00
SataQiu e48a3be64a define port 44134 as a constant
Signed-off-by: SataQiu <qiushida@beyondcent.com>
2019-04-18 10:52:06 +08:00
Matthew Fisher 62edd09800
Merge pull request #5606 from xichengliudui/update-go-const
Using const() defines constants together (part:1)
2019-04-17 09:46:32 -07:00
Matthew Fisher 0d81d92a01
Merge pull request #5112 from mortent/WaitCRDEstablished
fix(helm): Wait for CRDs to reach established state for crd_install hook
2019-04-15 09:29:33 -07:00
xichengliudui 5edb79df4c Using const() defines constants together (part:1)
Signed-off-by: xichengliudui <1693291525@qq.com>

update pull request
Signed-off-by: xichengliudui <1693291525@qq.com>

update pull request
Signed-off-by: xichengliudui <1693291525@qq.com>
2019-04-11 11:44:48 -04:00
Matthew Fisher 53d432fa58
Merge pull request #4871 from flant/fix-no-resource-with-the-name-found
Fix `no RESOURCE with the name NAME found`
2019-04-05 09:31:12 -07:00
Morten Torkildsen b8e40a7c31 fix(helm): Wait for CRDs to reach established state for crd_install hook
Makes sure CRDs installed through the crd_install hook reaches the `established` state before the hook is considered complete.

Signed-off-by: Morten Torkildsen <mortent@google.com>
2019-03-30 10:31:37 -07:00
Matthew Fisher 3c871c0030
chore(glide): bump kubernetes to 1.14
Signed-off-by: Matthew Fisher <matt.fisher@microsoft.com>
2019-03-26 10:51:40 -07:00
Timofey Kirillov 5ffe4ce588
Fix `no RESOURCE with the name NAME found`
This is the fix for only one particular, but important case.

The case when a new resource has been added to the chart and
there is an error in the chart, which leads to release failure.
In this case after first failed release upgrade new resource will be
created in the cluster. On the next release upgrade there will be the error:
`no RESOURCE with the name NAME found` for this newly created resource
from the previous release upgrade.

The root of this problem is in the side effect of the first release process,
Release invariant says: if resouce exists in the kubernetes cluster, then
it should exist in the release storage. But this invariant has been broken
by helm itself -- because helm created new resources as side effect and not
adopted them into release storage.

To maintain release invariant for such case during release upgrade operation
all newly *successfully* created resources will be deleted in the case
of an error in the subsequent resources update.

This behaviour will be enabled only when `--cleanup-on-fail` option used
for `helm upgrade` or `helm rollback`.

Signed-off-by: Timofey Kirillov <timofey.kirillov@flant.com>
2019-03-22 21:15:00 +03:00
Mikhail Kirpichev 63ef73d416 fix(tiller): fixed a typo in tiller and unit test
There was a typo in a tiller error with "released named" message, I've changed it to "a release named". Also fix a unit-test for it.

Signed-off-by: Mikhail Kirpichev <mkirpic@gmail.com>
2019-03-18 19:01:58 +03:00
Jacob LeGrone ce4c3f51ad
test(resource-policy): verify behavior of non-standard policy types
Signed-off-by: Jacob LeGrone <git@jacob.work>
2019-03-04 10:17:43 -05:00
Jacob LeGrone 55fbed95d5
feat(resource-policy): delete manifests when policy value is delete
Signed-off-by: Jacob LeGrone <git@jacob.work>
2019-03-04 10:09:48 -05:00
tuanvcw 268695813b Fix typos in various places (#5360)
Signed-off-by: Vu Cong Tuan <tuanvc@vn.fujitsu.com>
2019-02-26 07:41:50 -08:00
Miroslav Spousta 73a17eb599 Fix wording in error message (#5322)
Signed-off-by: Miroslav Spousta <qiq@ucw.cz>
2019-02-19 14:46:01 -08:00
Gábor Lipták bed4054c41 Correct golint warning (#5287)
Signed-off-by: Gábor Lipták <gliptak@gmail.com>
2019-02-10 01:14:32 -08:00
Alexander Matyushentsev f5df47b1c8 Fix: kind sorter incorrectly compares unknown and namespace (#5186)
Signed-off-by: Alexander Matyushentsev <AMatyushentsev@gmail.com>
2019-02-01 09:02:06 -08:00
lIuDuI 147dc225e2 Update func name (#5250)
* Update func name

Signed-off-by: xichengliudui <1693291525@qq.com>

* update pull request

Signed-off-by: xichengliudui <1693291525@qq.com>
2019-02-01 06:33:59 -08: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
James Ravn ab0ba3aa63 fix(tiller): respect resource policy on upgrade (#5225)
Don't delete a resource on upgrade if it is annotated with
helm.io/resource-policy=keep. This can cause data loss for users if the
annotation is ignored (e.g. for a PVC).

Closes #3673

Signed-off-by: James Ravn <james@r-vn.org>
2019-01-29 12:04:17 -08:00
Michelle Noorali 2b7221b5b7
Merge pull request #4088 from jgleonard/2751
#2715 add child NOTES.txt rendering
2019-01-16 12:16:11 -05:00
Matthew Fisher 29ab7a0a77
Revert "Fix for existing CRDs are deleted when crd-install hook is introduced (#4709)" (#5067)
This reverts commit e2a0e7fa54.

Signed-off-by: Matthew Fisher <matt.fisher@microsoft.com>
2018-12-19 12:24:00 -08:00
Frank Hamand 158d6dbb74 Add --parallel flag to helm test (#4144)
* Refactor test run to separate method

This will allow us to parallelise it more easily

Signed-off-by: Frank Hamand <frankhamand@gmail.com>

* Add --parallel flag to helm test

(No functionality in this commit)

Signed-off-by: Frank Hamand <frankhamand@gmail.com>

* Run helm tests in parallel with --parallel flag

Signed-off-by: Frank Hamand <frankhamand@gmail.com>

* Add a mutex to helm test message streams

This is to protect against data races when running tests in parallel.

Signed-off-by: Frank Hamand <frankhamand@gmail.com>

* Add tests for --parallel flag

Signed-off-by: Frank Hamand <frankhamand@gmail.com>

* Add concurrency limit for parallel helm tests

Signed-off-by: Frank Hamand <frankhamand@gmail.com>

* Add test for concurrency limit

Signed-off-by: Frank Hamand <frankhamand@gmail.com>

* Fix rebase introduced errors

Signed-off-by: Frank Hamand <frankhamand@gmail.com>
2018-12-05 14:04:48 -08:00
Michael Merrill e2a0e7fa54 Fix for existing CRDs are deleted when crd-install hook is introduced (#4709)
Signed-off-by: mmerrill3 <michael.merrill@vonage.com>
2018-11-29 10:09:10 -08: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
Morten Torkildsen 82d01cb312 fix(helm): Merge nested values correctly on upgrade (#4806)
Upgrading a release and override existing values doesn't work as expected for nested values. Maps should be merged recursively, but currently maps are treated just like values and replaced at the top level.

If the existing values are:
```yaml
resources:
  requests:
    cpu: 400m
  something: else
```
and an update is done with ```--set=resources.requests.cpu=500m```, it currently ends up as
```yaml
resources:
  requests:
    cpu: 500m
```
but it should have been
```yaml
resources:
  requests:
    cpu: 500m
  something: else
```

This PR updates the way override values are merged into the existing set of values to merge rather than replace maps.

Closes: #4792

Signed-off-by: Morten Torkildsen <mortent@google.com>
2018-11-12 12:32:21 +01:00
adshmh 57d1c1fd29 include the name of the missing object in release uninstall error (#4635)
* fix(tiller) added mock kube client to return failure on delete

Signed-off-by: Arash Deshmeh <adeshmeh@ca.ibm.com>

* fix(tiller) added object's name to delete release error message

Signed-off-by: Arash Deshmeh <adeshmeh@ca.ibm.com>
2018-11-06 21:08:18 -08:00
Jon Leonard a499cf3517
Merge branch 'master' into 2751 2018-11-01 15:02:17 -04:00
jgleonard 1518f961af fix(helm): add --render-subchart-notes flag to 'helm install' and 'helm upgrade'
When 'helm <install|upgrade> --render-subchart-notes ...' is run, this will include
the notes from the subchart when rendered via Tiller.

Closes #2751

Signed-off-by: jgleonard <jgleonard@gmail.com>
2018-11-01 14:57:01 -04:00
jgleonard ab9349c425 add child NOTES.txt rendering
Signed-off-by: jgleonard <jgleonard@gmail.com>
2018-11-01 14:56:46 -04:00
Matt Rasmus 0522b34e05 test(tiller): cover crash fixed by #4630 (#4853)
While investigating a tiller crash on v2.10.0 (see recent comments in #3125), I pulled down the code
and wrote a test replicating the crash I was experiencing. I then
realized that the crash had been fixed, and was able to locate the fix
in #4630 after running a quck bisect.

Since there don't appear to be any tests that cover this crash, and I
had written one myself, I figured I might as well put up a PR for it.

Here's what the test failure on v2.10.0 looks like:
```
-- FAIL: TestUpdateReleasePendingInstall_Force (0.00s)
panic: runtime error: invalid memory address or nil pointer dereference [recovered]
        panic: runtime error: invalid memory address or nil pointer dereference
[signal SIGSEGV: segmentation violation code=0x1 addr=0x50 pc=0x1d128d8]

goroutine 235 [running]:
testing.tRunner.func1(0xc420493c20)
        /usr/local/Cellar/go/1.10/libexec/src/testing/testing.go:742 +0x29d
panic(0x1eb8d80, 0x2a12db0)
        /usr/local/Cellar/go/1.10/libexec/src/runtime/panic.go:505 +0x229
k8s.io/helm/pkg/tiller.(*ReleaseServer).performUpdateForce(0xc4208210b0, 0xc4202c6dc0, 0x0, 0x0, 0x2174220)
        /Users/mattrasmus/go/src/k8s.io/helm/pkg/tiller/release_update.go:166 +0x188
k8s.io/helm/pkg/tiller.(*ReleaseServer).UpdateRelease(0xc4208210b0, 0x2191780, 0xc420820f30, 0xc4202c6dc0, 0x29aeb90, 0x38, 0x2d2)
        /Users/mattrasmus/go/src/k8s.io/helm/pkg/tiller/release_update.go:43 +0x245
k8s.io/helm/pkg/tiller.TestUpdateReleasePendingInstall_Force(0xc420493c20)
        /Users/mattrasmus/go/src/k8s.io/helm/pkg/tiller/release_update_test.go:549 +0x120
testing.tRunner(0xc420493c20, 0x20e5c70)
        /usr/local/Cellar/go/1.10/libexec/src/testing/testing.go:777 +0xd0
created by testing.(*T).Run
        /usr/local/Cellar/go/1.10/libexec/src/testing/testing.go:824 +0x2e0
FAIL    k8s.io/helm/pkg/tiller  0.118s
```

Signed-off-by: Matt Rasmus <mrasmus@betterworks.com>
2018-10-31 08:51:29 -07:00
Matt Tucker 147c8217c7 fix(tiller): correctly sort PodDisruptionBudget objects before pods that might use them (#4769)
Signed-off-by: Matt Tucker <ultimateboy@gmail.com>
2018-10-12 13:49:45 -06: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
Colin Panisset 12ace315ea Don't assume that the returned error from the storage driver isn't nil (#3625) (#4627)
Signed-off-by: Colin Panisset <colin.panisset@cevo.com.au>
2018-09-26 17:38:39 -07:00
Steve Wolter e868da1705 Check for err before working with newRelease. (#4630)
Should fix #4585.

Signed-off-by: Steve Wolter <swolter@google.com>
2018-09-17 12:41:27 -07:00
Matthew Fisher a297a0a7fe
fix merge conflicts/linter errors (#4653)
Signed-off-by: Matthew Fisher <matt.fisher@microsoft.com>
2018-09-17 09:48:51 -07:00
Matthew Fisher 5b23632446
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>
2018-09-10 11:14:03 -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