Commit Graph
1215 Commits
Author SHA1 Message Date
Morten Torkildsen b536c8de10 fix(helm): Print details for pod resource
Due to a regression from a previous change, details about pod resources
does not show up in the status output. This makes sure that the pod type
from core are passed in to the printer so the details are shown in the
output.

Signed-off-by: Morten Torkildsen <mortent@google.com>
(cherry picked from commit ede43a313d)
2018-12-05 14:43:57 -08:00
Matthew Fisher 657557947c bump version to v2.12
Signed-off-by: Matthew Fisher <matt.fisher@microsoft.com>
2018-11-30 11:05:43 -08:00
Martin Hickey 58be8e461c Update messaging in value parsing to improve traceability (#4974)
Closes #4736

Signed-off-by: Martin Hickey <martin.hickey@ie.ibm.com>
2018-11-30 10:04:37 -08:00
Morten Torkildsen 55a338579a fix(helm): Allow custom resources in hooks (#4986)
Currently the code that handles hooks uses a builder that creates the versioned types rather than unstructured. This results in an error whenever a custom resource is used in the hook as the type will not be registered in the scheme used in Helm. This changes this to use a builder that created unstructured resources and only converts to the versioned type when needed.

Signed-off-by: Morten Torkildsen <mortent@google.com>
2018-11-29 15:50:23 -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
Taylor Thomas a34baf0eea Merge pull request #4978 from ultimateboy/dont-delete-deployed
fix(storage): when pruning release versions, never delete the last deployed revision
2018-11-28 14:29: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
Luke Hoban 75b4afaa33 Allow missing trailing '/' in --repo url (#4956)
Apply the same procedure to allow missing trailing slash in repo base URLs used in `repo/chart` inputs to `--repo` inputs.

Fixes #4954.

Signed-off-by: Luke Hoban <luke@pulumi.com>
2018-11-28 11:15:49 -08:00
Matthew Fisher 97465abda0 fix(windows): fix unit tests on Windows (#4897)
Signed-off-by: Matthew Fisher <matt.fisher@microsoft.com>
2018-11-28 09:59:32 -08:00
e23793120b fix(helm): --set for out of order list values (#4682)
When a user specifies value overrides for list values out of order,
strvals.listItem panics. Change strvals.listItem to handle this case by
re-initializing nil values to a new map.

Closes #4503

Co-authored-by: Cameron Childress <cameron@cchildress.org>
Co-authored-by: Kevin Collette <hal.collette@gmail.com>
Co-authored-by: Connor McKelvey <connormckelvey@gmail.com>
Co-authored-by: Dan Winter <dan.j.winter@gmail.com>

Signed-off-by: Dan Winter <dan.j.winter@gmail.com>
Signed-off-by: Cameron Childress <cameron@cchildress.org>
Signed-off-by: Kevin Collette <hal.collette@gmail.com>
Signed-off-by: Connor McKelvey <connormckelvey@gmail.com>
2018-11-19 17:58:25 +01: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
Matt Farina e91e961587 Merge pull request #4809 from mortent/FixOutputWhitespace
fix(helm): Use line breaks consistently in status output
2018-11-09 11:05:36 -05:00
Matthew Fisher 9dce1ac88b s,kubernetes/charts,helm/charts,g (#4889)
Signed-off-by: Matthew Fisher <matt.fisher@microsoft.com>
2018-11-07 07:26:19 -08: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
Erik Sundell eb96576b8d Reform indentation practices using nindent (#4562)
The essence of this commit is to help people get started with a better
indentation practice than this:

```yaml
spec:
  labels:
{{ toYaml .Values.labels | indent 4 }}
```

The previous indentation practice is harder to read. Instead this commit
introduces an indentation practice using `nindent` like this:

```yaml
spec:
  labels:
    {{- toYaml .Values.labels | nindent 4 }}
```

Signed-off-by: Erik Sundell <erik.i.sundell@gmail.com>
2018-11-06 21:03:44 -08:00
Sean Eagan 6635bff38f fix(engine): Fix template rendering thread safety issue (#4828)
Remove the engine `currentTemplates` field which was shared state
across threads and thus not thread safe, and instead just pass these
reference templates as parameters down recursively.

Closes #4819

Signed-off-by: Sean Eagan <sean.eagan@att.com>
2018-11-06 14:00:26 -08:00
Adam Reese d5c183e297 Merge pull request #4859 from adamreese/ref/kube-external
ref(kube): use external api types where possible
2018-10-31 15:05:25 -07:00
Adam Reese fb0e03ebde ref(kube): use external api types where possible
Signed-off-by: Adam Reese <adam@reese.io>
2018-10-31 11:57:38 -07:00
Zachary Seguin 662fd4fcf6 Remove executable bits from chartutil generated files (#4839)
Signed-off-by: Zachary Seguin <zachary@zacharyseguin.ca>
2018-10-31 11:13:56 -07: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
Matthew Fisher e37dcf4e0b bump version to v2.11 (#4700)
Signed-off-by: Matthew Fisher <matt.fisher@microsoft.com>
(cherry picked from commit 3a551d01d8)
2018-10-31 08:50:08 -07:00
Morten Torkildsen 586dc1db61 fix(helm): Use line breaks consistently in status output
The output from helm status does not have consistent use of line breaks.
For some resources there is a line break after the kind header, for
others there is not. This is caused by how the printer handles column
headers. This removes a line break for all but the first resource listed.

Signed-off-by: Morten Torkildsen <mortent@google.com>
2018-10-18 22:48:40 -07:00
Morten Torkildsen dd9ed71429 fix(helm): Update status output to include resource details (#4791)
Update of the client-go package changed the status output to only include
the age of resources. The new printer in client-go only formats the output
to include details of specific resources if the internal representation
of resources are passed into the printer. This PR updates helm to convert
resources to the internal type before printing.

Closes #4712

Signed-off-by: Morten Torkildsen <mortent@google.com>
2018-10-18 15:17:09 -07:00
Martin Hickey f6efe2f0c1 Add test template example for helm create (#4524)
* Add test template example for helm create

As helm create ganerates an nginx chart, the example is based on
https://github.com/helm/helm/blob/master/docs/examples/nginx/templates/
service-test.yaml

Signed-off-by: Martin Hickey <martin.hickey@ie.ibm.com>

* Update after review

- https://github.com/helm/helm/pull/4524#pullrequestreview-155183390
- https://github.com/helm/helm/pull/4524#pullrequestreview-155379922
- Fix where app.kubernetes.io/instance was incorrect in service selector

Signed-off-by: Martin Hickey <martin.hickey@ie.ibm.com>

* Add doc update

Signed-off-by: Martin Hickey <martin.hickey@ie.ibm.com>

* Update GO formatting

Signed-off-by: Martin Hickey <martin.hickey@ie.ibm.com>
2018-10-17 14:10:46 -07:00
Anumita Shenoy 1e26b5300b feat(helm): add $HELM_KEY_PASSPHRASE environment variable for signing helm charts (#4778)
* feat(helm): add $HELM_KEY_PASSPHRASE environment variable for signing helm charts

If $HELM_KEY_PASSPHRASE is set then helm package sign command will not prompt the
user to enter the passphrase for the private key

Signed-off-by: Anumita Shenoy <ansheno@microsoft.com>

* docs(helm):  added documentation for HELM_KEY_PASSPHRASE

Added description for HELM_KEY_PASSPHRASE

Signed-off-by: Anumita Shenoy <ansheno@microsoft.com>
2018-10-16 08:46:35 -06: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 26c88ec815 Merge pull request #4703 from adshmh/4556-fix-paths-ingress-template
fix paths in the ingress template and values file written by helm create
2018-10-11 14:41:06 -07:00
Adam Reese e83a54f7a0 Merge pull request #4742 from florianrusch/patch-1
Add the `.vscode` folder to the `.helmignore` file
2018-10-11 14:39:51 -07:00
Adam Reese dfd0279b13 Merge pull request #4757 from teresy/redundant-nil-check-slice
Remove redundant nil checks
2018-10-11 08:33:32 -07:00
Adam Reese de5a6a931b Merge pull request #4734 from adamreese/ref/kube-1.12
ref(*): kubernetes v1.12 support
2018-10-11 08:32:49 -07:00
Rijnard van Tonder 5267c0d44a The nil check before the range loop is redundant
Signed-off-by: Rijnard van Tonder <hi.teresy@gmail.com>
2018-10-10 16:11:04 -04:00
Florian Rusch 6f12ab24a5 Add the .vscode folder to the .helmignore file
Signed-off-by: Florian Rusch <git@florianrusch.de>
2018-10-06 10:46:31 +02: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
adshmh 2ef61fdf5c feat(helm): use apps/v1 as deployment apiVersion (#4725)
Use 'apps/v1' as the apiVersion field for the deployment.yaml written
by the 'helm create' command, rather than the deprecated 'apps/v1beta2'.

Signed-off-by: Arash Deshmeh <adeshmeh@ca.ibm.com>
2018-10-01 12:27:17 -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
Arash Deshmeh 1a54463bdb fix(helm): fix paths in the ingress template and values file written by helm create
Signed-off-by: Arash Deshmeh <adeshmeh@ca.ibm.com>
2018-09-26 11:24:54 -04:00
Matthew Fisher 8be42bae88 fix(helm): fix regression with TLS flags/environment variables not being parsed (#4657)
* fix(helm): fix regression with TLS flags/envvars

This change fixes some of the assumptions made in an earlier commit. Helm's TLS flags and environment variables were not respected because they were parsed well before execution (during settings.AddFlagsTLS()), causing erroneous behaviour at runtime. By re-introducing environment.Init(), Helm can properly parse environment variables at the correct time.

One change that had to occur in this PR is the fact that we need to call settings.Init() each time we call settings.AddFlagsTLS(). This is because each command owns its own FlagSet, so we need to parse each flagset to read and propagate the environment variables correctly.

I also noticed that we were maintaining two separate variables for each TLS value. Refactoring out some of the older code to all use the settings object makes the code much cleaner to read and fixes an issue where setting a flag or environment variable would propagate to the settings object, but we'd be reading from tlsEnable.

I've also added some unit tests to ensure this regression doesn't occur again.

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

* fix bug where os.ExpandEnv() on the default value causes differing behaviour

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

* add more context to the TODO/FIXME messages

Signed-off-by: Matthew Fisher <matt.fisher@microsoft.com>
2018-09-19 11:20:32 -07:00
Caleb Delnay fbda50a452 Fix credentials not set for ResolveChartVersion default HTTP client (#4662)
Fixes Issue #4299 and Issue #4445

Signed-off-by: Caleb Delnay <calebdelnay@gmail.com>
2018-09-18 14:00:30 -07:00
Qiang Li 4dd9047586 fix(helm): fix selector typo in service template for 'helm create' (#4663)
changed instancelease to instance in service template

closes #4661

Signed-off-by: Qiang Li <liqiang@gmail.com>
2018-09-18 13:55:22 -07:00
Louis Munro 7b821dd52f Make ping() request a specific image. Add a getTillerPodImage method. (#4622)
Signed-off-by: Louis Munro <lm@louismunro.com>
2018-09-17 14:04:19 -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
Carlos Tadeu Panato Junior 71ba25a5a9 change kubernetes to helm in docs and yaml files when refer the repository (#4640)
Signed-off-by: cpanato <ctadeu@gmail.com>
2018-09-14 07:36:11 -07:00
Helgi Þormar Þorbjörnsson 0029708801 test and build with golang 1.11 (#4637)
linters were failing with: pkg/urlutil/urlutil_test.go:1:⚠️ file is not gofmted with -s (gofmt)

Signed-off-by: Helgi Þorbjörnsson <helgith@gmail.com>
2018-09-12 21:09:32 -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 bef59e40dc allow settings TLS flags from environment variables (#4590)
Signed-off-by: Matthew Fisher <matt.fisher@microsoft.com>
2018-09-07 13:23:40 -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
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
Christian Köberl 2e9855b98b Set proxy for all connections, fixes #4326 (#4579)
Signed-off-by: Christian Koeberl <christian.koeberl@gmail.com>
2018-09-03 06:57:41 -07:00