Commit Graph

628 Commits

Author SHA1 Message Date
KUOKA Yusuke e607bae5ff
Fix ignored chart version on patched release (#1276)
See https://sweetops.slack.com/archives/CE5NGCB9Q/p1590607083301900?thread_ts=1590237129.290300&cid=CE5NGCB9Q
2020-05-28 20:52:56 +09:00
KUOKA Yusuke 930f91a70d
Merge pull request #1273 from roboll/fix-chartify
fix: Follow-up fixes for #1172
2020-05-27 22:15:41 +09:00
Yusuke Kuoka 1cfce32e0d Add documentation for releases[].{strategicMergePatches,jsonPatches} 2020-05-27 22:15:12 +09:00
Yusuke Kuoka 29fdb57add fix: Support for kustomization as chart
A kustomization has not been properly chartified when a kustomization is specified on `releases[].chart` but there were no `releases[].strategicMergePatches` and `jsonPatches` specified.
This fixes that.
2020-05-27 22:07:52 +09:00
Yusuke Kuoka 68432b1848 fix: Do not skip passing values files when adhocDependencies/jsonPatches/jsonPatches exist
This is a follow-up for #1172
2020-05-27 21:13:05 +09:00
KUOKA Yusuke 16288dfa7d
feat: GA of Kustomize and K8s manifests support (#1172)
This is the GA version of the helm-x integration #673 developed last year.

You get all the following benefits without an extra helm plugin:

- Ability to add ad-hoc chart dependencies/aliases, without forking the chart (Fixes #876 )
- Ability to patch resulting K8s resources before installing the helm chart
- Ability to install a kustomization as a chart (Requires `kustomize` binary to be available in `$PATH`
- Ability to install a directory of K8s manifests as a chart
- etc.
2020-05-27 11:42:43 +09:00
Brian Choy 969de1ebc9
Fix typo in writing-helmfiles.md example (#1263) 2020-05-19 10:04:38 +09:00
Danny Shemesh ceb108a24f
Fixed part splitting for CLRF separated files (#1265)
Fixes https://github.com/roboll/helmfile/issues/1142

desired_state_file_loader.go
- Will now normalize the content before splitting it to parts

context:
Me & and a fellow dev have tried to figure out why helmfile didn't fill in certain values on his machine; 
turns out, he'd mistakenly checked out our project w/ CRLF line endings, which had caused part splitting to not work (as it's hard coded to look for '\n').

The following was acted on as a single part, causing values from the bases not to be available in the next yaml part:

```
bases:\r\n
  - base.yaml\r\n
---\r\n

releases:
  - name: external-secrets-crd
    ... some templated yaml ...
```

I've thought about regex-ing it out instead of replace-all, but benchmarks had shown that a plain replace is faster.

I've also considered splitting by "\n---" instead of "\n---", but that would break if the dashes were to continue with some other text.
2020-05-19 10:04:12 +09:00
hacker65536 576a07f497
fix: typo in README (#1254) 2020-05-12 09:42:07 +09:00
Craig Furman eb8ab54865
Optionally error when subhelmfiles do not exist (#1245)
This prevents typos in helmfiles from silently preventing operations
from running. The default behavior is to print a warning, to preserve
backwards compatibility.
2020-05-12 09:41:39 +09:00
Yusuke Kuoka 9e4bc6e7fc chore: Add retries for downloading kubectl in docker builds 2020-05-09 14:31:52 +09:00
James F McMahon ef2d8853c2
README: Add note about environment variable types (#1251)
Fixes https://github.com/roboll/helmfile/issues/1248
2020-05-09 14:12:52 +09:00
machine424 66f34580c3
feat: Add global `--debug` flag for passing `--debug` to helm (#1236)
Add a global flag --debug that sets the logging level to debug and passes the global flag --debug to Helm through the implementation of subcommands’ --args.

Resolves #1104

Co-authored-by: ayoub mrini <amrini@wiremind.fr>
2020-05-09 14:11:54 +09:00
Guillaume Perrin 6d5f8c71cb
Allow skipping chart-related operations when `installed: false` (#1233)
Resolves #1232

CHANGES:

* Disable repo update when installed is false

When install is false, we do not need to update the repositories and get
the chart.

Signed-off-by: Guillaume Perrin <guillaume28.perrin@gmail.com>
2020-05-09 14:03:56 +09:00
刘相轩 23be9af2db
Show executed command when errors occurred (#1252) 2020-05-09 13:35:31 +09:00
Cédric de Saint Martin 1e9e228a9a
Dockerfile: Upgrade to Helm v3.2.1. (#1253) 2020-05-09 13:34:46 +09:00
Rick Stokkingreef c72cab80b5
Bump variantdev/vals for Vault AppRole support (#1239)
Co-authored-by: Rick Stokkingreef <rick.stokkingreef@takeaway.com>
2020-05-02 09:40:16 +09:00
Victor Noël 923bd54db0
Use namespace for release unicity with helm3 (#1213) (#1235)
This is for #1213 so that the releases are considered scoped to their namespace and not to tiller namespace.

Fixes #1213
2020-05-02 09:35:51 +09:00
nejtr0n a0e30c5193
Correct ordering between releases and sub-helmfiles on destroy/delete (#1234)
Fixes #1192

Co-authored-by: Alexey Shishkin <a.shishkin@directheroes.com>
2020-05-01 09:06:13 +09:00
Cédric Lamalle daf8c2f12b
Upgrade helm to v3.2.0 (#1231)
* Upgrade helm to v3.2.0
2020-04-29 15:00:49 +09:00
Craig Dunford d71ac15748
Enhance createNamespace error handling (#1227)
- An error is raised if createNamespace is set explicitly and the
  helm version being used is not 3.2+
2020-04-27 08:59:44 +09:00
Craig Dunford eeb61e6174
Support for createNamespace (#1226)
- createNamespace is a new attribute that can be added to helmDefaults
  or an individual release to enforce the creation of a release namespace
  during sync if the namespace does not exist. This leverages helm's
  (3.2+) --create-namespace flag for the install/upgrade command. If
  running helm < 3.2, the createNamespace attribute has no effect.

Resolves #891
Resolves #1140
2020-04-26 10:41:40 +09:00
Marcin Kaciuba b1190508b2
feat(template): added secret template function (#1221)
* feat(tmpl): added fetchSecretValue template function

This adds a tmpl `fetchSecretValue` and `expandSecretRefs` function by:
- Adding:
    - `expandSecretRefs` function in tmpl package that uses vals
    package to fetch secrets
    - `fetchSecretValue` function in tmpl package like below but for
    single string value
    - gomock for tests purpose
- Changing:
    - move init of vals package to function (so the same instance can be used for template values and rendering the whole template)

* doc(secret): added doc how to use new tmpl methods

Added example usage of `fetchSecretValue` and `expandSecretRefs`
2020-04-25 21:10:02 +09:00
Ash Caire 3a19a394ab
Add condition release attribute (#1190) 2020-04-23 08:43:34 +09:00
Jesse Glick dcb19f942b
Typo: kustommize (#1224) 2020-04-23 08:38:33 +09:00
Eric Bailey 458385d971
Amend examples which broke lock files in README.md (#1225)
Prior to this change, these two examples suggested enclosing a release spec in
an if expression, which breaks the lock file when switching environments.

This change parameterizes `installed` instead of the entire release, thus
preserving the dependency locking functionality.
2020-04-23 08:38:01 +09:00
chenrui b89fba1cc2
Bump golang to v1.14.2 (#1132)
* Bump golang to v1.14.2

* Use gotest.tools/v3
2020-04-21 09:06:29 +09:00
KUOKA Yusuke 6b6b86a0b5
Bump variantdev/vals to v0.4.0 (#1217)
For GCP Secrets Manager support
2020-04-18 23:22:23 +09:00
Rene Hernandez e0a793b7c5
New output flag for list command (#1215)
* New output flag for list command

Support output as json
Add new formatters file to handle extrac formatting to its own concern
New config interface to support list command specification

* Fix usage message

* Add error handling for formatters
2020-04-18 21:11:12 +09:00
Danny Shemesh 71bb7354e7
Fix: populate .Values regardless of prestate success (#1202)
This commit proposes a potential solution for
https://github.com/roboll/helmfile/issues/1201

The gist is that, if prestate rendering fails, for any reason,
we do not populate the .Values in the second pass renderer.

I think that what have been expected in this case is to populate the
.Values irregardless.

pkg/app/two_pass_renderer.go
- Migrated to use finalEnv.GetMergedValues()

pkg/environment/environment.go
- Introduced GetMergedValues, which merges the environment's defaults
and current values, and then casts the keys to string;
This was previously defined in HelmState.Values() - however, as this
method is only concerned with the environment, I think it's more
appropriate for it to sit here.

pkg/state/state_exec_tmpl.go
- Extracted out HelmState.Values() to environment.go, see above
2020-04-17 09:18:01 +09:00
KUOKA Yusuke 3a34d28d7c
fix: helmDefaults.timeout and releases[].timeout not working for `helmfile test` (#1211)
Fixes #1191
2020-04-17 09:08:21 +09:00
Douglas Hellinger f39d7928bf
Put tiller on path for use in helm-tiller plugin (#1198)
Put tiller binary on the path in helm v2.X container image so that helm-tiller plugin will use it instead of duplicating the download of helm tarball and performing version check.
2020-04-14 09:18:18 +09:00
Vadim Bauer e0811dffa2
Update helmfile.yaml example in README (#1189)
- Adds default comments into helmfile.yaml example

- Fixes some typos

Signed-off-by: Vadim Bauer <vb@8gears.com>
2020-04-10 08:27:09 +09:00
RaymondKYLiu 7d11f5dedc
feat: add tmpl function `required` (#1188)
Co-authored-by: Raymond Liu (RD-TW) <raymond_liu@trend.com.tw>
2020-04-10 08:23:42 +09:00
KUOKA Yusuke 870cc03c70
feat: `helmfile diff --detailed-exitcode` should also detect deletions (#1186)
Resolves #499
Resolves #1072
2020-04-10 08:22:33 +09:00
KUOKA Yusuke 98886df5d2
fix: .Values is missing keys with zero values (#1185)
Ref #1184
2020-04-10 08:21:23 +09:00
RaymondKYLiu 71635caace
feat: add option `--include-tests` for diff and apply command (#1179)
Co-authored-by: Raymond Liu (RD-TW) <raymond_liu@trend.com.tw>
2020-04-05 17:43:54 +09:00
KUOKA Yusuke 486be0970d
Bump vals to 0.3.0 (#1175)
vals v0.3.0 introduces the terraform output source that can be accessed by `ref+tfstate://path/to/tfstatefile/type.resourcename.prop` syntax. Please see the updated README section of vals for more info.
2020-04-04 19:50:01 +09:00
KUOKA Yusuke 9d7d2de6f5
Fix misleading `helmfile diff` output (#1174)
Fixes #749
2020-04-04 17:39:20 +09:00
KUOKA Yusuke 04c963d050
feat: Complete `helmfile diff` output when diff exists (#1173)
Fixes #874
2020-04-04 16:24:01 +09:00
KUOKA Yusuke a2c62c9e73
feat: Emit clear error message instead of panic on empty chart name (#1171)
Resolves #999
2020-04-04 15:32:22 +09:00
KUOKA Yusuke 1654ce4c18
Add regression tests for environment values merge (#1170)
This is a follow-up for #1169 and it also relates to #1168
2020-04-04 14:27:29 +09:00
KUOKA Yusuke 25aae679b1
Merge pull request #1169 from elodani/master
fix: empty map merge was not working after mergo bump
2020-04-04 14:00:41 +09:00
Daniel Elo d404356230 feat: fix empty map merge after mergo bump
since mergo had been bumped to 0.3.9 an environment value like:
```
affinity: {}
```
was not merged properly (not merged at all) instead it threw an error
that it cannot find the key "affinity" in the environment values even
though it was outputted in debug output as read in properly.
2020-04-03 15:01:27 +02:00
KUOKA Yusuke 51ecd12360
Fix panic while loading environment secrets (#1164)
This fixes a regression in #1160
2020-03-30 20:13:40 +09:00
KUOKA Yusuke 6643a41ea3
fix: merge environment values by ovewriting with empty values (#1162)
Fixes #1154
2020-03-29 20:47:23 +09:00
KUOKA Yusuke 35e5454994
Change the `helmfile list` header "INSTALLED" -> "ENABLED" (#1161)
Resolves #1076
2020-03-29 19:11:58 +09:00
KUOKA Yusuke 69feadc360
feat: `helmBinary` in helmfile.yaml (#1160)
* feat: `helmBinary` in helmfile.yaml

Resolves #1083

* Add regression test for `helmfile destroy`
2020-03-29 17:51:07 +09:00
KUOKA Yusuke f676c61425
feat: Better exec error reporting (#1159)
Enhances Helmfile to print more helpful message on error while calling `exec` template function.

Helmfile has been printing error messages like the below:

```
in ./helmfile.yaml: error during helmfile.yaml.part.0 parsing: template: stringTemplate:5:8: executing "stringTemplate" at <exec "./exectest.sha" (list)>: error calling exec: exit status 1
```

Adding captured stdout and stderr, with some indentation to make it readable, it now produces the following message on missing executable:

```
$ make build && ./helmfile build
go build
in ./helmfile.yaml: error during helmfile.yaml.part.0 parsing: template: stringTemplate:5:8: executing "stringTemplate" at <exec "./exectest.sha" (list)>: error calling exec: fork/exec ./exectest.sha: no such file or directory

COMMAND:
  ./exectest.sha

ERROR:
  fork/exec ./exectest.sha: no such file or directory
```

On non-zero exit status without output:

```
$ make build && ./helmfile build
go build
in ./helmfile.yaml: error during helmfile.yaml.part.0 parsing: template: stringTemplate:5:8: executing "stringTemplate" at <exec "./exectest.sh" (list)>: error calling exec: exit status 1

COMMAND:
  ./exectest.sh

ERROR:
  exit status 1
```

On non-zero exit status with output:

```
$ make build && ./helmfile build
go build
in ./helmfile.yaml: error during helmfile.yaml.part.0 parsing: template: stringTemplate:5:8: executing "stringTemplate" at <exec "./exectest.sh" (list)>: error calling exec: exit status 2

COMMAND:
  ./exectest.sh

ERROR:
  exit status 2

COMBINED OUTPUT:
  out1
  err1
```

Resolves #1158
2020-03-29 10:49:02 +09:00
KUOKA Yusuke 20a39e9412
Bump mergo to 0.3.8 (#1153)
Fixes #1150
2020-03-20 18:56:43 +09:00