Commit Graph

254 Commits

Author SHA1 Message Date
Matt Butcher ab797325c6
fix: backport #6901 to Helm 2 (#7196)
Signed-off-by: Matt Butcher <matt.butcher@microsoft.com>
2019-12-17 10:33:16 -07:00
Jeff Knurek ef5d4e652c
change GetPodLogs to return io.Reader instead of string
well, more specifically returns an io.ReadCloser (giving the consumer more capabilities)

Signed-off-by: Jeff Knurek <j.knurek@travelaudience.com>
2019-10-08 13:31:14 -07:00
Jeff Knurek a2e8b188c2
TEST: add some rudimentary test code for helm test logs
Signed-off-by: Jeff Knurek <j.knurek@travelaudience.com>
2019-10-08 13:30:46 -07:00
Jeff Knurek b94608388e
TEST: add option to dump logs during helm test
Signed-off-by: Jeff Knurek <j.knurek@travelaudience.com>
2019-10-08 13:30:45 -07:00
Matthew Fisher b6afc6bf46
Merge pull request #4985 from bkeroackdsc/client-accept-contexts
Helm client: add methods that accept contexts
2019-10-04 11:44:47 -07:00
Benjamen Keroack 545e2213be helm client: add methods that accept contexts so callers can cancel long-running operations
Signed-off-by: Benjamen Keroack <benjamen@dollarshaveclub.com>
2019-10-04 11:26:01 -07:00
Ting-Wai ed8f17a889 Parameterize maximum number of tests pods to run in parallel (#6078)
Signed-off-by: Ting-Wai To <tingwai@bitgo.com>
2019-10-04 10:50:19 +01:00
陈谭军 9d8a84ee3d fix-up typo (#6501)
Signed-off-by: chentanjun <2799194073@qq.com>
2019-09-25 14:10:51 +01:00
Matt Farina aa4dae0535
Updating to newer versions of dependencies
* This was initiated by new versions from Masterminds
* Linting was set to check for the same chart version as the other
  checks of this were. >0.0.0-0. The -0 is important to pull in
  prereleases. The latest version of semver Validate now finds
  errors here properly where some were missed before
* 0.0.0 is a valid semantic version. Instead of expecting it to be
  invalid in the tests to check validation now using an invalid
  semantic version

Signed-off-by: Matt Farina <matt@mattfarina.com>
2019-09-18 12:49:06 -04:00
Gasmi Christophe 256765aa74 Networkpolicy kind sort (#6266)
* Add NetworkPolicy in kind sorter

Signed-off-by: Christophe GASMI <rekcah78@gmail.com>

* Added NetworkPolicy to sort order test

Signed-off-by: Christophe GASMI <rekcah78@gmail.com>
2019-08-26 10:43:07 +01:00
AllenZMC 53f1ab50e5 fix wrong spells in hooks.go
Signed-off-by: czm <zhongming.chang@daocloud.io>
2019-08-06 10:18:37 +08:00
AllenZMC 915d69a2c6 fix word 'resoures' to 'resources
Signed-off-by: czm <zhongming.chang@daocloud.io>
2019-08-03 22:05:52 +08:00
Tariq Ibrahim 276bb9b1c8
fix golint issues reported by make test
Signed-off-by: Tariq Ibrahim <tariq181290@gmail.com>
2019-07-24 16:24:55 -07:00
Constantin Bugneac 535df90cc8 Added HorizontalPodAutoscaler to sort order.
Signed-off-by: Constantin Bugneac <constantin.bugneac@worldfirst.com>
2019-07-19 11:37:03 +01:00
Seb Ospina 320e853b8d Added List mode for Role, ClusterRole and Bindings
Kubernetes supports RoleList, RoleBindingList, ClusterRoleList and
ClusterRoleBindingList, in order for a Role to be bound, it must
already exist.
For the List reference, see: https://github.com/kubernetes/kubernetes/blob/master/pkg/apis/rbac/types.go

Signed-off-by: Seb Ospina <kraige@gmail.com>
2019-07-13 09:17:49 +02:00
willise a1b391951e ref(tiller): add more info when force update
Signed-off-by: willise <sunshuai@cmss.chinamobile.com>
2019-07-04 01:13:33 +08:00
Martin Hickey c3242d1be4
Merge pull request #5532 from mortent/WaitForDelete
fix(helm): Delete hooks should wait for resource to be removed from etcd before continuing
2019-06-21 17:03:32 +01:00
Morten Torkildsen cb2207c2fb fix(helm): Delete hooks should wait for resource to be removed from etcd before continuing
Signed-off-by: Morten Torkildsen <mortent@google.com>
2019-06-20 11:56:31 -07:00
Matt Farina 35b740af22
Adding Kinds to the capabilities apiversions lookup for templates
This will enable the detection of specific objects including CRDs
that may vary widely between kubernetes clusters

Signed-off-by: Matt Farina <matt@mattfarina.com>
2019-06-04 14:49:52 -04:00
Morten Torkildsen 94adb5bbe0 fix(helm): Only validate new manifests
Signed-off-by: Morten Torkildsen <mortent@google.com>
2019-04-24 20:30:19 -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