Commit Graph

936 Commits

Author SHA1 Message Date
Anton Bretting 2f04831817
Fix various golangci-lint errors (#2059) 2022-02-12 20:28:08 +09:00
Quan TRAN 9a2df3c0a2 add example to demonstrate remote helmfiles & remote charts
Signed-off-by: Quan TRAN <account@itscaro.me>
2022-02-12 17:52:52 +09:00
Quan TRAN baafe702b2 use user cache directory for remote helmfiles
Signed-off-by: Quan TRAN <account@itscaro.me>
2022-02-12 17:52:52 +09:00
Quan TRAN 242e601898 add subcommands `cache info` `cache cleanup`
Signed-off-by: Quan TRAN <account@itscaro.me>
2022-02-12 17:52:52 +09:00
Quan TRAN cf02442591 goGetterChart() downloads to user cache dir instead of working dir 2022-02-12 17:52:52 +09:00
Quan TRAN 766b03047c
Enable get() to be used with alias $.StateValues (#2081) 2022-02-09 09:18:46 +09:00
Sören Jentzsch 19927fc147
feat: Add --suppress option for diff and apply commands (#2077) 2022-02-03 08:46:39 +09:00
Yusuke Kuoka 061644c5d0
Fix readdir regression while merging (#2061)
Ref https://github.com/roboll/helmfile/pull/2058#issuecomment-1019439394
2022-01-23 20:37:46 +09:00
Nils 1d70130ab9
Fix ReadDir templating function to respect base path (#2058)
Ref https://github.com/roboll/helmfile/pull/1934#issuecomment-1018663764
2022-01-23 12:20:56 +09:00
drivelikebrazil debd3c0eea
Add `--skip-tests` to helmfile template command (#2057)
* Add skip-tests to helmfile template command

* Fix formatting
2022-01-22 15:26:17 +09:00
Yusuke Kuoka 87e5903705 Stop infinite loop of deleting/creating tag on release 2022-01-10 09:07:06 +00:00
Yusuke Kuoka 9e9a90f8ef
Fix panic on normalizing path containing .. (#2042)
Fixes #2039
2022-01-10 17:45:44 +09:00
Quan TRAN c069fbf268
add cleanup to write-values & lint to harmonise this flag (#2021) 2022-01-10 17:32:02 +09:00
Christoph Petrausch 346e318fd0
Correct enabled property in helmfile list (#1921)
Use the value of the `condition` field instead of the `installed` field of a release in the `enabled` column of helmfile list.
The value of the `installed` field is shown in a new `installed` column.

Fixes #1920

Co-authored-by: Yusuke Kuoka <ykuoka@gmail.com>
2022-01-10 17:24:07 +09:00
Nils 753de35ee0
Add readDir as a templating function (#1934)
Adds a new templating function called `readDir`. With `readDir` users can read the contents of a specified directory and get a list of all contained files. This is useful when reading a bunch of files from a directory. The following example shows a snippet of a values file for configuring a Logstash deployment. Using only `readFile`, a user must specify each file by hand and adjust this list as the number of files to be read grows.
```yaml
logstash:
  configs:
    logstash.yml: |
      {{- tpl (readFile "config/logstash.yml.gotmpl") . | nindent 6 }}
    jvm.options: |
      {{- readFile "config/jvm.options" | nindent 6 }}
    pipelines.yml: |
      {{- readFile "config/pipelines.yml" | nindent 6 }}
  pipelines:
    beats-log4j.conf: |
      {{- readFile "config/pipelines/beats-log4j.conf" | nindent 6 }}
    nginx-access.conf: |
      {{- readFile "config/pipelines/nginx-access.conf" | nindent 6 }}
    nginx-error.conf: |
      {{- readFile "config/pipelines/nginx-error.conf" | nindent 6 }}
    syslog-logs.conf: |
      {{- readFile "config/pipelines/syslog-logs.conf" | nindent 6 }}
    tcp-logs.conf: |
      {{- readFile "config/pipelines/tcp-logs.conf" | nindent 6 }}
    udp-debug.conf: |
      {{- readFile "config/pipelines/udp-debug.conf" | nindent 6 }}
    udp-logs.conf: |
      {{- readFile "config/pipelines/udp-logs.conf" | nindent 6 }}
  certificates:
    ca.crt: |
      {{- readFile "config/certificates/ca.crt" | nindent 6 }}
    logstash.crt: |
      {{- readFile "config/certificates/logstash.crt" | nindent 6 }}
    logstash.key: |
      {{- readFile "config/certificates/logstash.key" | nindent 6 }}
```
With `readDir` the above snippet can be rewritten as follows:
```yaml
logstash:
  configs:
  {{- range readDir "config" }}
    {{ base . }}: |
      {{- if hasSuffix "gotmpl" . }}
          {{- tpl (readFile .) $ | nindent 6 }}
      {{- else }}
          {{- readFile . | nindent 6 }}
      {{- end }}
  {{- end }}
  pipelines:
  {{- range readDir "config/pipelines" }}
    {{ base . }}: |
      {{- readFile . | nindent 6 }}
  {{- end }}
  certificates:
  {{- range readDir "config/certificates" }}
    {{ base . }}: |
      {{- readFile . | nindent 6 }}
  {{- end }}
```
2022-01-10 17:22:24 +09:00
Samo Jelovšek 16f19613fb
Set postsync and cleanup error (#2009)
Fixes #1272
2022-01-10 17:11:13 +09:00
Graeme Gillies 8bdf377be0
Bump sprig library to v3.2.1 (#1880)
Fixes #1646

This will allow us to use the new `fromJson` and `mustFromJson` functions
among others.

Co-authored-by: Graeme Gillies <ggillies@gitlab.com>
2022-01-10 17:04:08 +09:00
aperigault 9e58082342
Allow users other than root to use helm plugins (#1766)
Resolves #1134

Co-authored-by: Antony Perigault <antony.perigault@cpexterne.org>
2022-01-10 16:55:00 +09:00
Luke Plausin 4d01eddd3d
Added example ArgoCD + helmfile deployment (#1882) 2022-01-10 16:44:47 +09:00
Yusuke Kuoka 91aa0acddb
Update README.md
Relates to #2002
2022-01-10 16:37:02 +09:00
Yusuke Kuoka 1735fb5bed
Bump helm-diff to version 3.3.1 (#2041)
helm-diff 3.3.1 adds a new option `HELM_DIFF_THREE_WAY_MERGE=true` which enables the use of there-way merge for diff, which is expected to fix #2013
2022-01-10 16:21:14 +09:00
Mårten Svantesson fe8a176db5
feat: Option to pass kubeVersion to helm template (#2002) 2022-01-07 09:05:03 +09:00
Micah Huber 94f99536c6
support apple silicon builds (#2032) 2022-01-07 09:02:30 +09:00
Simon Caron 578c559640
Bumped go-getter to v1.5.9 (#1982)
Co-authored-by: Simon Caron <simon.caron@protonmail.com>
2022-01-07 09:00:29 +09:00
Travis Truman b101f9ff8d
Fix capitalization of disableOpenAPIValidation config in README (#2003)
See https://github.com/roboll/helmfile/blob/master/pkg/state/state.go#L220
2022-01-07 08:59:49 +09:00
Quan TRAN 170e29a558
bump to go 1.17.3 with alpine 3.13 (#2024)
* bump to go 1.17.5

* bump to go 1.17.3 for circleci

* use alping 3.15 & helm 3.7.2

* use golang 1.17.3 and alpine 3.13 instead

because of this issue: https://wiki.alpinelinux.org/wiki/Release_Notes_for_Alpine_3.14.0#faccessat2
2022-01-07 08:58:54 +09:00
Ian Muge 554cbc19f5
upgrade vals allowing for the use of the AzureRM terraform backend (#2029) 2022-01-07 08:57:33 +09:00
Babis K d34dc7bb64
Add support for --insecure-skip-tls-verify flag on helm repo add command (#1990)
Parses a new field in repositories named `skipTLSVerify` and if set to `true`, it appends `--insecure-skip-tls-verify` in `helm repo add` command.

This should be useful with internal self-signed repos, mitm proxies etc.

Resolves #1871
2021-12-21 09:18:57 +09:00
Jonas Rutishauser 1986cb37aa
feat: Add go-getter support to load base helmfiles (#1998)
Resolves #1193
2021-12-21 09:16:24 +09:00
Yusuke Kuoka 9efb7afb47
Do fail on a possible typo in `needs` entries (#2026)
* Do fail on a possible typo in `needs` entries

Helmfile kindly fails with a friendly error when you made a typo in a `needs` entry, i.e. a `needs` entry included a reference to a release that is not defined in the helmfile config.

Example Output:

```
in ./helmfile.needs.yaml: release(s) "app" depend(s) on an undefined release "infrastructure/cert-manager2". Perhaps you made a typo in `needs` or forgot defining a release named "cert-manager2" with appropriate `namespace` and `kubeContext`?
```

This prevents issues like #1959

* Fix regression in helmfile-diff (This may break when you had two or more duplicated releases that are intended to be de-duplicated before DAG calculation using selectors

* Fix regression when you used selector to deduplicate releases before DAG calculation

* Comments

* Fix regressions in helmfile-apply and helmfile-sync

* Fix regression in duplicate release detection
2021-12-18 17:44:55 +09:00
Anatoly Medvedkov 3d7b4287b3
Fix typo in README (#2006) 2021-12-16 09:55:24 +09:00
pjotre86 ca6dd7a60f
Make .Environment values available in .gotmpl files. (#2000)
Currently it's not possible to use `.Environment` values in `*.gomtpl` files. The documentation states the opposite: 
https://github.com/roboll/helmfile#environment (2nd paragraph).
The problem is already described in #1090.
This PR fixes this bug.
Fixes #1090

Co-authored-by: Peter Aichinger <petera@topdesk.com>
2021-11-04 10:04:01 +09:00
pjotre86 9354c38a0a
Process feedback for pr 1983 (#1992)
* Guard collectNeeds-method against infinite recursion.

* Also check for namespace and kubecontext when collecting needs.

Co-authored-by: Peter Aichinger <petera@topdesk.com>
2021-10-22 08:29:33 +09:00
pjotre86 c0668874e3
Add documentation for needs parameterization. (#1987)
* Add documentation for needs parameterization.

Co-authored-by: Peter Aichinger <petera@topdesk.com>
2021-10-21 08:36:00 +09:00
pjotre86 77e6268bcb
Add support for transitive dependencies. (#1983)
Co-authored-by: Peter Aichinger <petera@topdesk.com>
2021-10-20 17:55:08 +09:00
Aditya Menon 9a0ce53608
Support Helm 3.7.0's reworked OCI support (#1970)
Signed-off-by: Aditya Menon <aditya.menon@spin.pm>
2021-10-04 09:19:15 +09:00
vseryozhenko 787e6c80d1
ubuntu docker based image for helmfile (#1863)
Co-authored-by: Valera Seryozhenko <vseryozhenko@healthjoy.com>
2021-09-14 16:01:34 +09:00
Nicolas Sterchele 724b4b36f3
readme: fix wrong paths for environments on conf example (#1885)
As we are using "environments" all over the place this allows to add
clarity
2021-09-14 15:58:53 +09:00
James Christian 2792ef75d1
bug: write-values deletes provided --values files. (#1905)
This fixes the bug by not including provided values files in the array of generated values, which is evalutated in a defered block.
Resolves #1904
2021-09-14 14:51:22 +09:00
Yusuke Kuoka f57b510d01
Fix json patches and strategic patches to do work when there was only one resource in the targeted chart/directory (#1962)
Ref https://github.com/roboll/helmfile/issues/1954
2021-09-14 14:48:20 +09:00
Yusuke Kuoka 7845cccd23
Stop integration test for Helm 2.17.0 (#1961)
It turned out the Helm 2.17.0 binary is nowhere now. I considered a bit about checking for a newer Helm 2.x releases as an alternative but I resisted as it is almost a year since EoL of Helm 2. Thanks Helm 2. Long live Helm 3!
2021-09-14 05:19:53 +09:00
Yusuke Kuoka e1cabc82e3
Add support for --validate on chartify (#1960)
Apparently we needed to pass `--validate` on helm-template run by chartify when the targeted chart contains Capabilities.APIVersions in a chart template. Otherwise, you can never make such chart work with chartify, as at apply time helm template expressions that involved Capabilities.APIVersions are already nowhere.
2021-09-14 04:48:21 +09:00
Alex Meddin 0f91f2c9cf
Add IKEA to users. (#1925) 2021-09-14 04:41:19 +09:00
George Gaál 8594944f63
Update writing-helmfile.md (#1937)
fix small typo
2021-09-14 04:36:40 +09:00
Rei ae438c8e9e
Add more examples for remote env value files (#1938) 2021-09-14 04:36:05 +09:00
Jake Hill ad2f8e87e6
Add debian docker image, drop helm2, upgrade packages. (#1956)
- Add debian image based on `stable-slim`, desire for this is largely
  around my use case using Azure DevOps which makes it challenging to
  use images which are not glibc based.
- Drop support for helm2 in the docker images. This is a tricky one but
  given that I was having errors during the docker build for helm2 and
  the fact that it has been EoL for a long time now made me think that
  this was the correct move.
- As a "while I'm in here" I've upgraded kubectl and helm. I've popped
  on the most current patch of the last release (v1.20.3) to give a
  slightly broader support for different Kubernetes versions.
- Reworked CI to support pushing a debian and alpine base, and dropped
  support for the helm2 versions.
2021-09-14 04:30:32 +09:00
Yusuke Kuoka ccd81de77e Set longer no_output_timeout for release
Ref https://support.circleci.com/hc/en-us/articles/360007188574-Build-has-hit-timeout-limit
2021-07-26 00:04:11 +00:00
Evgenii Tereshkov d8247e6543
Update writing-helmfile.md: fix typos (#1892) 2021-07-02 07:31:47 +09:00
Alex Meddin 46b17e2cdb
feat: pass-credentials to repo (#1899)
This adds the ability to include the --pass-credentials flag to the helm add repo command by:

- Adding repo.passCredentials to the helmfile yaml
- Changing state, helmexec, and app to include RepositorySpec.PassCredentials

Resolves #1898

Co-authored-by: almed4 <alexandre.meddin@ingka.ikea.com>
2021-07-02 07:31:16 +09:00
Yusuke Kuoka c623730374
Bump golang.org/x/crypto (#1877)
Resolves #1876
2021-06-10 09:16:11 +09:00