Commit Graph

187 Commits

Author SHA1 Message Date
Yusuke Kuoka 858c233272
Cancel rendering helmfile parts once the missing env is detected in the previous part (#941)
* Cancel rendering helmfile parts once the missing env is detected in the previous part

Fixes #913

Signed-off-by: Yusuke Kuoka <ykuoka@gmail.com>
2023-07-23 17:23:41 +08:00
Jan-Otto Kröpke d1c260af5f
feat: Allow to skip diff output on release base (#906)
* feat: Allow to skip diff output on release base

Signed-off-by: Jan-Otto Kröpke <mail@jkroepke.de>

* fix tests

Signed-off-by: Jan-Otto Kröpke <joe@cloudeteer.de>

* feat: Allow to skip diff output on release base

Signed-off-by: Jan-Otto Kröpke <mail@jkroepke.de>

* fix tests

Signed-off-by: Jan-Otto Kröpke <joe@cloudeteer.de>

* s/skipDiffOutput/suppressDiff

Signed-off-by: Jan-Otto Kröpke <joe@cloudeteer.de>

* s/skipDiffOutput/suppressDiff

Signed-off-by: Jan-Otto Kröpke <joe@cloudeteer.de>

* fix tests

Signed-off-by: Jan-Otto Kröpke <mail@jkroepke.de>

---------

Signed-off-by: Jan-Otto Kröpke <mail@jkroepke.de>
Signed-off-by: Jan-Otto Kröpke <joe@cloudeteer.de>
2023-07-02 07:50:59 +08:00
yxxhero c55fa0f765
Replace interface{} by any (#901)
Signed-off-by: yxxhero <aiopsclub@163.com>
2023-06-16 10:49:05 +09:00
yxxhero afcc9e4b80
fix: chartifyOpts ignore release set values (#896)
* fix: chartifyOpts ignore release set values

Signed-off-by: yxxhero <aiopsclub@163.com>
2023-06-13 23:28:27 +08:00
yxxhero 1843cc447e
Add insecure skip tls verify support (#882)
* feat: add insecure-skip-tls-verify support

Signed-off-by: yxxhero <aiopsclub@163.com>
2023-06-04 16:34:24 +08:00
yxxhero e67eb0c973
Upgrade helm diff version (#883)
feat: bump helm diff to v3.8.0

Signed-off-by: yxxhero <aiopsclub@163.com>
2023-06-04 10:29:32 +08:00
yxxhero ae77967bf2
cleanup: remove tls configures about helm v2 (#880) 2023-06-03 22:02:46 +08:00
xiaomudk c498af3f52
Fix set flag are ignored when used in conjunction with jsonPatches (#867)
* Fix set flag are ignored when used in conjunction with jsonPatches

Signed-off-by: xiaomudk <xiaomudk@gmail.com>
2023-05-24 07:29:19 +08:00
yxxhero 643f888703
fix: loadBases overrodeEnv issue (#838) 2023-05-08 05:24:32 +08:00
Dmitry Chepurovskiy aa5be82834
Make helmfile respect signals send by kill command (not only Ctrl+C in terminal) (#750)
Fixes #746 

Signed-off-by: Dmitry Chepurovskiy <me@dm3ch.net>
Signed-off-by: yxxhero <aiopsclub@163.com>
Co-authored-by: yxxhero <aiopsclub@163.com>
2023-04-29 15:25:29 +09:00
yxxhero bfb94314be
bump chartify to v0.14.0 (#759)
Signed-off-by: yxxhero <aiopsclub@163.com>
2023-03-21 18:52:42 +08:00
yxxhero 95c56d87fc
v1: Fix --state-values-set to override values of environments colocated with releases (#705) 2023-03-05 16:03:00 +08:00
xiaomudk a8574ba0cf
Fix post-renderer flag not working in diff and template subcommand (#691)
Signed-off-by: xiaomudk <xiaomudk@gmail.com>
2023-02-14 10:47:24 +08:00
Yusuke Kuoka fc027d1538
breaking: Fix the inherit feature to support multi-inheritance (#674)
* breaking: Fix the inherit feature introduced in Helmfile v0.150.0 for multi-inheritance

Follow-up for #435
Addresses https://github.com/helmfile/helmfile/discussions/656#discussioncomment-4877360 towards Helmfile v1

Signed-off-by: Yusuke Kuoka <ykuoka@gmail.com>

* Print a deprecation warning on releases[].inherit of map

Signed-off-by: Yusuke Kuoka <ykuoka@gmail.com>

---------

Signed-off-by: Yusuke Kuoka <ykuoka@gmail.com>
2023-02-07 08:18:19 +08:00
yxxhero b44aaf90f7
remove helm v2 code in tests (#648)
Signed-off-by: yxxhero <aiopsclub@163.com>

Signed-off-by: yxxhero <aiopsclub@163.com>
2023-01-24 07:02:57 +09:00
yxxhero 1664edd0b9
add --skip-charts for destroy for disable prepare charts (#637)
* add --skip-charts for destroy for disable prepare charts

Signed-off-by: yxxhero <aiopsclub@163.com>

* add --skip-charts for delete subcmd

Signed-off-by: yxxhero <aiopsclub@163.com>

* add docs and e2e test

Signed-off-by: yxxhero <aiopsclub@163.com>

Signed-off-by: yxxhero <aiopsclub@163.com>
2023-01-21 11:54:59 +09:00
yxxhero a724ab73f6
fix inherit chart empty check issue (#635)
Signed-off-by: yxxhero <aiopsclub@163.com>

Signed-off-by: yxxhero <aiopsclub@163.com>
2023-01-19 09:37:22 +08:00
xiaomudk 1f134d931f
fix fetch does not work with kustomized releases (#624)
* fix fetch does not work with kustomized releases

Signed-off-by: xiaomudk <xiaomudk@gmail.com>

* add tests

Signed-off-by: yxxhero <aiopsclub@163.com>

Signed-off-by: xiaomudk <xiaomudk@gmail.com>
Signed-off-by: yxxhero <aiopsclub@163.com>
Co-authored-by: yxxhero <aiopsclub@163.com>
2023-01-15 09:19:01 +08:00
Yusuke Kuoka 4688cf0132
Use gopkg.in/yaml.v2 for Helmfile v0.x (#609)
This should fix #435 for Helmfile v0.x releases since the next v0.150.0.
We introduce a new envvar to opt-in to the new YAML library, so that you can give it a shot before upgrading your Helmfile to v1. The same envvar can be used to opt-out of the new YAML library after you upgrade to Helmfile v1, giving you a more flexible migration story.

Signed-off-by: Yusuke Kuoka <ykuoka@gmail.com>
2023-01-04 18:17:24 +09:00
Yusuke Kuoka 490bb5d147
feat: `inherit` field for release template inheritance (#606)
* feat: `inherit` field for release template inheritance

Ref https://github.com/helmfile/helmfile/issues/435#issuecomment-1364749414

Signed-off-by: Yusuke Kuoka <ykuoka@gmail.com>

* Fix wording

Signed-off-by: Yusuke Kuoka <ykuoka@gmail.com>

* Comment on releaseWithInheritedTemplate

Signed-off-by: Yusuke Kuoka <ykuoka@gmail.com>

* Update Release Template doc with the new `inherit` feature

Signed-off-by: Yusuke Kuoka <ykuoka@gmail.com>

* Fix a typo in code comment

Signed-off-by: Yusuke Kuoka <ykuoka@gmail.com>

Signed-off-by: Yusuke Kuoka <ykuoka@gmail.com>
2022-12-28 10:01:04 +09:00
yxxhero d8cb740dcf
fix env value lost in environment values (#605)
* fix env value lost in environment values

Signed-off-by: yxxhero <aiopsclub@163.com>

* add more test

Signed-off-by: yxxhero <aiopsclub@163.com>

Signed-off-by: yxxhero <aiopsclub@163.com>
2022-12-27 09:48:07 +08:00
Yusuke Kuoka 6664f01596
Use goccy/go-yaml for v1 / Prep bringing back go-yaml v2 for v0.x (#604)
This is a successor to #596. We need a smooth migration path from `gopkg.in/yaml.v2`, and this pull request moves it forward with `goccy/go-yaml` instead of `gopkg.in/yaml.v3`. Merging this unblocks users stuck in Helmfile v0.146.x or earlier due to #435, so that they can upgrade to 0.147.x or greater without updating their helmfile configs.

We previously tried to upgrade to `yaml.v3` (https://github.com/helmfile/helmfile/issues/394) in Helmfile v0.x, presuming it won't break anything. Apparently, it broke use-cases where you want to layer release's `values` field over three or more release templates and releases (#435).

We then tried to bring back `yaml.v2` for Helmfile v0.x and keep `yaml.v3` for the upcoming Helmfile v1. However, it failed due to incompatibility in the Unmarshaller interface between `yaml.v2` and `yaml.v3` (https://github.com/helmfile/helmfile/pull/596).

`goccy/go-yaml` is, from my observation, a well-maintained alternative to `yaml.v2`. One of its premises is that it enables us to swap the implementation from `gopkg.in/yaml.v2` to `goccy/go-yaml` just by replacing the import directive. It seems to use the same `Unmarshaller` interface as yaml.v2 too.

Once this PR gets merged, I'd like to follow-up with adding a new build-time variable and an envvar to set the proper default for the yaml parser Helmfile uses and the ability to switch the parser at runtime. All in all, the next Helmfile release, v0.150.0 will get reverted to use `gopkg.in/yaml.v2` by default which resolves #435.

New users who started using Helmfile since any of v0.148.0, v0.148.1, and v0.149.0 might be already relying on the new behavior, They might need to specify a new envvar to enable `goccy/go-yaml`.

Signed-off-by: yxxhero <aiopsclub@163.com>
Signed-off-by: yxxhero <aiopsclub@163.com>
Co-authored-by: yxxhero <aiopsclub@163.com>
2022-12-27 10:14:35 +09:00
yxxhero d8d0bf830a
Add helmfile state validate policy (#592) 2022-12-21 10:49:31 +08:00
yxxhero 36c91c5427
optimize lint logic (#586)
Signed-off-by: yxxhero <aiopsclub@163.com>
2022-12-18 08:39:45 +08:00
yxxhero 5da1200a8b
add post render integration test (#576)
Signed-off-by: yxxhero <aiopsclub@163.com>
2022-12-14 11:38:47 +08:00
Quan TRAN 7860ac988a
Remove temporary dir as well (#563)
Fixes #540

Signed-off-by: Quan TRAN <account@itscaro.me>
Signed-off-by: yxxhero <aiopsclub@163.com>
Co-authored-by: yxxhero <aiopsclub@163.com>
2022-12-14 08:33:07 +09:00
Yusuke Kuoka a93035a3e5 Revert "Add e2e test for helmfile-diff with post-renderer"
This reverts commit a3e8c0426c.

Signed-off-by: Yusuke Kuoka <ykuoka@gmail.com>
2022-12-13 07:12:48 +00:00
yxxhero 89d9a9b3a2
Merge branch 'main' into main 2022-12-13 13:18:13 +08:00
yxxhero 773b0d6fc4 fix e2e
Signed-off-by: yxxhero <aiopsclub@163.com>
2022-12-13 13:12:07 +08:00
yxxhero 04729b027a fix e2etest
Signed-off-by: yxxhero <aiopsclub@163.com>
2022-12-13 13:12:07 +08:00
Yusuke Kuoka a3e8c0426c Add e2e test for helmfile-diff with post-renderer
Signed-off-by: Yusuke Kuoka <ykuoka@gmail.com>
Signed-off-by: yxxhero <aiopsclub@163.com>
2022-12-13 13:12:07 +08:00
Yusuke Kuoka 9f702280ae Add e2e test for post-renderer
Signed-off-by: Yusuke Kuoka <ykuoka@gmail.com>
Signed-off-by: yxxhero <aiopsclub@163.com>
2022-12-13 13:12:07 +08:00
yxxhero 9b0eeaad94 Update output.yaml
Signed-off-by: yxxhero <aiopsclub@163.com>
2022-12-13 13:12:07 +08:00
Indrek Juhkam 608bb0b525 Avoid --skip-refresh on local charts (#541)
All the dependencies get correctly installed when dealing with remote
charts.

If there's a local chart that depends on remote dependencies then those
don't get automatically installed. See #526. They end up with this
error:

```
Error: no cached repository for helm-manager-b6cf96b91af4f01317d185adfbe32610179e5246214be9646a52cb0b86032272 found. (try 'helm repo update'): open /root/.cache/helm/repository/helm-manager-b6cf96b91af4f01317d185adfbe32610179e5246214be9646a52cb0b86032272-index.yaml: no such file or directory
```

One workaround for that would be to add the repositories from the local
charts. Something like this:

```
cd local-chart/ && helm dependency list $dir 2> /dev/null | tail +2 | head -n -1 | awk '{ print "helm repo add " $1 " " $3 }' | while read cmd; do $cmd; done
```

This however is not trivial to parse and implement.

An easier fix which I did here is just to not allow doing
`--skip-refresh` for local repositories.

Fixes #526

Signed-off-by: Indrek Juhkam <indrek@urgas.eu>

Signed-off-by: Indrek Juhkam <indrek@urgas.eu>
Signed-off-by: yxxhero <aiopsclub@163.com>
2022-12-13 13:12:07 +08:00
Indrek Juhkam bdc6982172
Avoid --skip-refresh on local charts (#541)
All the dependencies get correctly installed when dealing with remote
charts.

If there's a local chart that depends on remote dependencies then those
don't get automatically installed. See #526. They end up with this
error:

```
Error: no cached repository for helm-manager-b6cf96b91af4f01317d185adfbe32610179e5246214be9646a52cb0b86032272 found. (try 'helm repo update'): open /root/.cache/helm/repository/helm-manager-b6cf96b91af4f01317d185adfbe32610179e5246214be9646a52cb0b86032272-index.yaml: no such file or directory
```

One workaround for that would be to add the repositories from the local
charts. Something like this:

```
cd local-chart/ && helm dependency list $dir 2> /dev/null | tail +2 | head -n -1 | awk '{ print "helm repo add " $1 " " $3 }' | while read cmd; do $cmd; done
```

This however is not trivial to parse and implement.

An easier fix which I did here is just to not allow doing
`--skip-refresh` for local repositories.

Fixes #526

Signed-off-by: Indrek Juhkam <indrek@urgas.eu>

Signed-off-by: Indrek Juhkam <indrek@urgas.eu>
2022-12-12 16:43:10 +09:00
dependabot[bot] a6df2f8148
build(deps): bump k8s.io/apimachinery from 0.25.4 to 0.26.0 (#568)
* build(deps): bump k8s.io/apimachinery from 0.25.4 to 0.26.0

Signed-off-by: dependabot[bot] <support@github.com>
2022-12-10 13:26:40 +08:00
yxxhero 70a1b3b513
Fix snapshot tests to pass regardless of helm version (#572)
* Fix snapshot tests to pass regardless of helm version

Signed-off-by: yxxhero <aiopsclub@163.com>
2022-12-10 10:54:03 +08:00
Quan TRAN 398c812e49
Use go-getter with secrets as well (#560)
* Use go-getter with secrets as well

Signed-off-by: Quan TRAN <account@itscaro.me>
2022-12-09 07:46:28 +08:00
yxxhero 211852cd38
use dyff as yamldiff tool (#542)
Signed-off-by: yxxhero <aiopsclub@163.com>

Signed-off-by: yxxhero <aiopsclub@163.com>
2022-11-27 09:47:09 +09:00
yxxhero 36996df980 fix unit test
Signed-off-by: yxxhero <aiopsclub@163.com>
2022-11-24 21:05:16 +08:00
yxxhero 5c5dc42ef5
Refactor integration tests (#531)
* refactor integrations

Signed-off-by: yxxhero <aiopsclub@163.com>

* Update the integration test directory structure to better correlate the test script with testdata

Signed-off-by: Yusuke Kuoka <ykuoka@gmail.com>

* Undo the test-cases directory renaming to make the diff more easy to understand

Signed-off-by: Yusuke Kuoka <ykuoka@gmail.com>

* fix ci

Signed-off-by: yxxhero <aiopsclub@163.com>

Signed-off-by: yxxhero <aiopsclub@163.com>
Signed-off-by: Yusuke Kuoka <ykuoka@gmail.com>
Co-authored-by: Yusuke Kuoka <ykuoka@gmail.com>
2022-11-23 14:44:16 +09:00
xiaomudk 7844145ee3
Allow helmfile statefile to passed by stdin (#520)
* Allow helmfile statefile to passed by stdin

Signed-off-by: xiaomudk <xiaomudk@gmail.com>
2022-11-22 11:34:05 +08:00
xiaomudk 766c1c951f Remove redundant metadata fields from test samples
Signed-off-by: xiaomudk <xiaomudk@gmail.com>
2022-11-22 10:33:05 +08:00
yxxhero 143f85b4f1 fix: helmfile template fails when selector matches a chart fetched with go-getter
Signed-off-by: yxxhero <aiopsclub@163.com>
2022-11-13 15:10:57 +08:00
Lassi Pölönen 0f44cfacc4
Add the ability to specify a lock file (#432)
Allow configuring the lockfile in the state. This makes it possible for
example maintain a lock per environment.

Signed-off-by: Lassi Pölönen <lassi.polonen@iki.fi>

Signed-off-by: Lassi Pölönen <lassi.polonen@iki.fi>
2022-11-12 08:59:56 +09:00
yxxhero 1513035718 test: add template anchors merge e2e test
Signed-off-by: yxxhero <aiopsclub@163.com>
2022-11-04 20:56:56 +08:00
yxxhero b0bb03a0ea fix unittest
Signed-off-by: yxxhero <aiopsclub@163.com>
2022-11-04 12:53:38 +08:00
yxxhero 82004b53f9
split run.sh to make run.sh be more clear. (#485)
split run.sh

Signed-off-by: yxxhero <aiopsclub@163.com>

Signed-off-by: yxxhero <aiopsclub@163.com>
2022-11-04 10:51:57 +09:00
xiaomudk 6dcde20d7a
Add subcommand init for checks and installs helmfile deps (#389)
* Add subcommand init for checks and installs helmfile deps

Signed-off-by: xiaomudk <xiaomudk@gmail.com>
2022-11-03 14:51:30 +08:00
Quan TRAN e919b4b1d2
fix oci:// chart (#477)
* fix oci:// chart

Signed-off-by: Quan TRAN <itscaro@users.noreply.github.com>
2022-11-01 13:50:05 +08:00
Quan TRAN 414f899c28
use fs.Getwd() to get working dir for sub helmfile (#471)
* use fs.Getwd() to get working dir for sub helmfile

Signed-off-by: Quan TRAN <itscaro@users.noreply.github.com>
2022-10-29 07:40:40 +08:00
yxxhero 2e7261426a fix chart needs test issue
Signed-off-by: yxxhero <aiopsclub@163.com>
2022-10-28 14:45:24 +08:00
yxxhero bc255f3e51 fix: fix need logic in chart stage
Signed-off-by: yxxhero <aiopsclub@163.com>
2022-10-24 09:51:04 +08:00
yxxhero bdaafdff67
feat: add helm-diff and kustomize in ci matrix (#434)
* feat: add helm-diff and kustomize in ci matrix

Signed-off-by: yxxhero <aiopsclub@163.com>
2022-10-13 08:08:58 +08:00
yxxhero bffa048dc6
Merge pull request #396 from helmfile/bump_yaml_v3
bump: upgrade gopkg.in/yaml.v2 to gopkg.in/yaml.v3
2022-10-05 10:12:25 +08:00
yxxhero 69d77507ee
update helm-diff version to 3.5.0 (#379)
Signed-off-by: yxxhero <aiopsclub@163.com>

Signed-off-by: yxxhero <aiopsclub@163.com>
2022-10-05 11:02:49 +09:00
yxxhero b347eec6f2 add more tests
Signed-off-by: yxxhero <aiopsclub@163.com>
2022-10-03 11:47:46 +08:00
yxxhero 5367fbe549 add more tests
Signed-off-by: yxxhero <aiopsclub@163.com>
2022-10-03 11:24:58 +08:00
yxxhero f6fd754386 add more tests
Signed-off-by: yxxhero <aiopsclub@163.com>
2022-10-03 11:09:02 +08:00
yxxhero 14ba7cd156 bump: upgrade gopkg.in/yaml.v2 to gopkg.in/yaml.v3
Signed-off-by: yxxhero <aiopsclub@163.com>
2022-10-03 05:24:51 +08:00
Tsubasa Nagasawa e8a7e23d4d
chore: add e2e test case for helm template with oci based helm chart
Signed-off-by: Tsubasa Nagasawa <toversus2357@gmail.com>
2022-09-18 19:11:26 +09:00
Rodrigo Fior Kuntzer 8408b021f0
feat: show live output from the Helm binary (#286)
* feat: show live output from the Helm binary

Signed-off-by: Rodrigo Fior Kuntzer <rodrigo@miro.com>

* fixup! Merge branch 'main' into enable-live-output

Signed-off-by: Yusuke Kuoka <ykuoka@gmail.com>
2022-09-18 14:24:35 +09:00
KqLLL 0fbcb07bad
Support helm-secrets v4.0.0 (#360)
Support helm-secret v4.0.0

Signed-off-by: KqLLL <lllkq546449541@gmail.com>
2022-09-17 19:54:28 +09:00
Viktor Oreshkin a56303b5bf hack: fix flaky e2e test
Signed-off-by: Viktor Oreshkin <imselfish@stek29.rocks>
2022-09-02 18:36:27 +03:00
yxxhero 86072ca200 use helmfile testdata
Signed-off-by: yxxhero <aiopsclub@163.com>
2022-08-28 10:36:21 +09:00
yxxhero 7434872c6b
fix ci error in issue.2118.yaml (#319)
Signed-off-by: yxxhero <aiopsclub@163.com>

Signed-off-by: yxxhero <aiopsclub@163.com>
2022-08-26 10:59:28 +09:00
Arkaitz Jimenez cc33e7b7d8
Introduce Helmfile's own filesystem abstraction to correctly unit test some components (#307)
Use abstracted FS

Signed-off-by: Arkaitz Jimenez <arkaitzj@gmail.com>

Signed-off-by: Arkaitz Jimenez <arkaitzj@gmail.com>
2022-08-24 12:58:43 +09:00
Arkaitz Jimenez c9b5f95890 lint
Signed-off-by: Arkaitz Jimenez <arkaitzj@gmail.com>
2022-08-16 16:25:24 +02:00
Arkaitz Jimenez 4553efdcf1 Formatting
Signed-off-by: Arkaitz Jimenez <arkaitzj@gmail.com>
2022-08-16 16:25:24 +02:00
Arkaitz Jimenez 824f7ba2b2 Create failing test case
Signed-off-by: Arkaitz Jimenez <arkaitzj@gmail.com>
2022-08-16 16:25:24 +02:00
yxxhero 8690d63401 fix lint error
Signed-off-by: yxxhero <aiopsclub@163.com>
2022-08-13 07:40:32 +08:00
vasicvuk 68d7c5f6a4 Implement readDirEntries method
Signed-off-by: vasicvuk <vuk.vasic@asseco-see.rs>
2022-07-26 16:20:38 +02:00
Yusuke Kuoka 098684c136 E2E helmfile-template testing with local chart repo server
This similar to #239, but different in that it involves a local helm chart repo server instead of a local OCI registry as the container of the chart used in tests.

This also adds a new `localChartRepoServer.enabled` config to the `config.yaml` of each test case directory to enable the local helm repo server in the test, which might be useful when you want to add another test case that involes a remote chart(which is hosted in the local chart repo server).

Signed-off-by: Yusuke Kuoka <ykuoka@gmail.com>
2022-07-20 11:59:32 +00:00
Tsubasa Nagasawa ac1edafe9a
chore: clean up snapshot test
Signed-off-by: Tsubasa Nagasawa <toversus2357@gmail.com>
2022-07-19 00:08:09 +09:00
Yusuke Kuoka 48ae800f79 Add integration test with local oci repo
Follow-up for #238

Signed-off-by: Yusuke Kuoka <ykuoka@gmail.com>
2022-07-18 13:43:01 +00:00
yxxhero ac23def893 add Go lint
Signed-off-by: yxxhero <aiopsclub@163.com>
2022-07-16 20:21:11 +08:00
Eng Zer Jun ce3b81e2a1
test: use `T.Setenv` to set env vars in tests (#189)
This commit replaces `os.Setenv` with `t.Setenv` in tests. The
environment variable is automatically restored to its original value
when the test and all its subtests complete.

Reference: https://pkg.go.dev/testing#T.Setenv
Signed-off-by: Eng Zer Jun <engzerjun@gmail.com>
2022-06-30 09:15:34 +09:00
yxxhero 6e5a726ae5
fix ci issue (#131)
Signed-off-by: yxxhero <aiopsclub@163.com>
2022-06-05 15:31:36 +09:00
Yusuke Kuoka b986b3de9f
Merge pull request #99 from yxxhero/add_e2e_tmpl_test
add e2e tmpl test
2022-06-05 13:23:08 +09:00
yxxhero 070ed0dd47 fix intergration test for argo-cd form master to main branch
Signed-off-by: yxxhero <aiopsclub@163.com>
2022-05-30 07:45:01 +08:00
yxxhero 9011d2dd15 fix import path name error
Signed-off-by: yxxhero <aiopsclub@163.com>
2022-05-24 07:50:08 +08:00
yxxhero c34c7c87a1 add get tpl e2e test
Signed-off-by: yxxhero <aiopsclub@163.com>
2022-05-24 07:50:08 +08:00
yxxhero 23b6429f33 add toYaml and fromYaml
Signed-off-by: yxxhero <aiopsclub@163.com>
2022-05-24 07:50:08 +08:00
yxxhero 33c66a6f46 add readfile e2e test
Signed-off-by: yxxhero <aiopsclub@163.com>
2022-05-24 07:50:08 +08:00
yxxhero 70b874a596 add more testcases
Signed-off-by: yxxhero <aiopsclub@163.com>
2022-05-24 07:50:08 +08:00
yxxhero 80457d964c add e2e tmpl test
Signed-off-by: yxxhero <aiopsclub@163.com>
2022-05-24 07:50:08 +08:00
Quan TRAN 3cae3f4f89 add integration test
Signed-off-by: Quan TRAN <account@itscaro.me>
2022-04-11 23:41:28 +02:00
yxxhero 303ef9cd80 remove ioutil usage in all project
Signed-off-by: yxxhero <aiopsclub@163.com>
2022-04-03 15:53:19 +08:00
Yusuke Kuoka dbc40f68b8
Make release template to work on `needs` (#2099)
It turned out that Helmfile has never had support for release template on `needs`.
This adds that, along with the new end-to-end test suite to verify helmfile template output with snapshot testing involving a real `helmfile build` command.

Ref #2098
2022-03-10 18:42:55 +09:00
Anton Bretting 2f04831817
Fix various golangci-lint errors (#2059) 2022-02-12 20:28:08 +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
Yusuke Kuoka 72e71608b1
Fix chartify regression of missing chart dependencies (#1869)
* Fix chartify regression of missing chart dependencies

Fixes https://github.com/roboll/helmfile/issues/1867

* Add integration test cases for issues #1857 and #1867
2021-06-08 13:06:26 +09:00
Yusuke Kuoka 44fb68b7e0
Use the incubator chart repo instead of chartcenter (#1833)
As ChartCenter has been shut down.

Ref https://github.com/roboll/helmfile/pull/1829#issuecomment-833330609
2021-05-08 17:33:24 +09:00
astorath 83189dbad3
Enable `helmfile-diff` to pass the output format to helm-diff (#1784)
* tests: fix vagrant test run

* feat: added an option to specify the different diff output format

* renamed diff-output to output

* renamed diff-output to output

Co-authored-by: Andrey Tuzhilin <andrey@zelf.co>
2021-04-24 08:07:24 +09:00
Yusuke Kuoka 28ade19419
Bump chartify to 0.8.2 (#1793)
* Bump chartify to 0.8.2

This version fixes charitfy not to fail when you used the combination of (1)helm 3 and (2)strategicMergePatches/jsonPatches/transformers etc that triggers chartify on (3)a chart that contains CRDs.

See https://github.com/roboll/helmfile/issues/1778#issuecomment-824451990 for details of the issue.

The chartify-side of this fix is 55b23f9e9d

Fixes #1778
2021-04-23 09:53:52 +09:00
Quan TRAN c65bdff62c
Respect release filter in lint and status (#1672)
Ref #1190
Fixes #1651

Co-authored-by: Yusuke Kuoka <ykuoka@gmail.com>
2021-04-06 15:47:29 +09:00
Philipp Hossner 85accf7330
Add helm-secrets-encrypted values template file (#1701)
Secret files ending with .gotmpl are now also rendered as a gotemplate.

```
releases:
- name: myapp
  secrets:
  - secrets.yaml.gotmpl
```

Note that currently, .gotmpl files must be valid YAML files as well.

The expected use-case of this feature is to compose a YAML array from values and encrypted secrets.

Without this feature, you would have tried to do something like the below, which didn't work.

**Example (doesn't work!)**

`values.yaml.gotmpl`:

```
environment:
  -   name: MY_EXTERNAL_IP
      value: |
          {{ exec "./get-external-ip.sh" (list "") }}
```

`secrets.yaml`:
```
_sops:
  #...
environment:
  - name: MY_SECRET_VALUE
    value: (encrypted by sops)
```

`helmfile.yaml`:

```
releases:
- name: foo
  values:
  - values.yaml
  secrets:
  - secrets.yaml
```

This doesn't work because `values.yaml` and the decrypted `secrets.yaml` are passed to `helm` to be merged, and helm overrides the array instead of merging or concatenating the arrays.

**Example (works!)**

Instead of `values.yaml` and `secrets.yaml`, you provide a single `secrets.yaml.gotmpl` that is a valid YAML and encrypted by sops:

```
_sops:
  #...
environment:
  -   name: MY_EXTERNAL_IP
      value: |
          {{ exec "./get-external-ip.sh" (list "") }}
  - name: MY_SECRET_VALUE
    value: (encrypted by sops)
```

`helmfile.yaml`:

```
releases:
- name: foo
  secrets:
  - secrets.yaml.gotmpl
```

Helmfile decrypts the gotmpl by handing it over to helm-secrets and then renders the result as a gotmpl file. The end result is that you have a two-element array `environments` that can be just passed to helm.

Resolves #1700

Co-authored-by: Yusuke Kuoka <ykuoka@gmail.com>
2021-04-06 14:20:42 +09:00
astorath aafe74a3e1
Fix/secrets ordering (#1726)
Fixes issue introduced in #790: the order of secrets merged is not defined now, leading to unpredictable results in `helmfile apply`.
2021-03-23 18:00:57 +09:00
Andrey Tuzhilin 4efaa656f9 test: return all tests 2021-03-23 17:19:40 +09:00
Andrey Tuzhilin 59f4043fc5 fix: fixed secrets decryption failed issue 2021-03-23 17:19:40 +09:00