Commit Graph

125 Commits

Author SHA1 Message Date
yxxhero 643f888703
fix: loadBases overrodeEnv issue (#838) 2023-05-08 05:24:32 +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
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
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
yxxhero d8d0bf830a
Add helmfile state validate policy (#592) 2022-12-21 10:49:31 +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
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 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
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
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
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
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
yxxhero 6e5a726ae5
fix ci issue (#131)
Signed-off-by: yxxhero <aiopsclub@163.com>
2022-06-05 15:31:36 +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
Quan TRAN 3cae3f4f89 add integration test
Signed-off-by: Quan TRAN <account@itscaro.me>
2022-04-11 23:41:28 +02: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
Andrey Tuzhilin d04cd1b1a7 test: fix "Ensure helmfile fails when no helm-secrets is installed" test 2021-03-23 17:19:40 +09:00
Andrey Tuzhilin 781c4e9ebe test: fix "Ensure helmfile fails when no helm-secrets is installed" test 2021-03-23 17:19:40 +09:00
Andrey Tuzhilin 0c9934c357 test: ensure bash -eo pipefail (as in circleci) 2021-03-23 17:19:40 +09:00
Andrey Tuzhilin 7610d8d3c6 test: add secrets integration tests 2021-03-23 17:19:40 +09:00
Andrey Tuzhilin 45b8eb6942 test: fix helm2 integration tests 2021-03-23 17:19:40 +09:00
Andrey Tuzhilin 4f02196dad test: reusable integration test 2021-03-23 17:19:40 +09:00
Chris Mellard 2a71640095
feat: added in oci repository flag and added helm methods to pull and export charts (#1629) 2021-01-28 09:02:00 +09:00
Yusuke Kuoka f6bf885fb7
Fix `helmfile template --include-crds` not to break with `chartify` (#1583)
* Fix `helmfile template --include-crds` not to break with `chartify`

This bumps variantdev/chartify to 0.4.9 so that we can incorporate fed8bb2953

* Fix integration test
2020-11-12 09:26:43 +09:00
Yusuke Kuoka 942b9a64c0
Add support for ChartCenter (#1492)
Resolves #1326
2020-09-21 15:31:24 +09:00
Yusuke Kuoka d3daea3137
Fix panic on hook since v0.126.0 (#1448)
Fixes #1445
2020-09-01 10:37:21 +09:00
KUOKA Yusuke ab1c118022
Bump chartify to v0.4.0 (#1409)
* Bump chartify to v0.4.0

Should fix #1338

* Bump minimum Helm 3 version to v3.1.0 for `helm template --include-crds`
2020-08-12 09:52:51 +09:00
ento face92536c
Add integration test for Kustomize inetgration (#1288)
Summary of changes:

* Output any error from Mkdir in `helmfile template`

* Add failing test for .Release.Name interpolation

* Add golden files for testing

* Parse resources with kustomize to compare them structure by structure

* Decode resources into plain maps

The RNode type from kustomize uses yaml.Node under the hood,
which carries extra information like line numbers, which
become noisy when comparing with deep.Equal.
2020-06-16 09:06:52 +09:00
KUOKA Yusuke 0186254e79
feat: --detailed-exitcode for `helmfile apply` (#1120)
Resolves #1113
2020-02-26 21:09:05 +09:00
KUOKA Yusuke 45943f9306
Bump Helm to v3.0.0 (#965) 2019-11-15 08:40:20 +09:00
KUOKA Yusuke f466800e1a
Fix regression since 0.90.0 that Helmfile becomes too slow when there are many releases (#964)
* Fix regression since 0.90.0 that Helmfile becomes too slow when there are many releases

Fixes #959

* Ensure that the up-to-date helm-diff is installed and used in integration tests
2019-11-14 20:57:04 +09:00
Yusuke Kuoka f47d8ea256 Integration tests with Helm v3.0.0-rc.2 2019-11-02 15:52:01 +09:00
KUOKA Yusuke 94a6fcfb9f
feat(diff,apply): --context=N for limiting diff context (#849)
Resolves #787
2019-09-12 18:36:13 +09:00
KUOKA Yusuke fb2041555e
feat(diff,apply): --no-color for removing color from output (#848)
Resolves #788
2019-09-12 18:32:30 +09:00
KUOKA Yusuke f61334d9bb
fix: `helmfile template | kubectl apply -f -` should work (#697)
Fixes #685
2019-06-16 16:56:56 +09:00
Yusuke KUOKA a769d1a82a fix integration test 2019-05-15 13:21:48 +09:00
KUOKA Yusuke b0179218b9
fix: helmfile panicing on missing lock file (#596)
Fixes #595
2019-05-15 13:16:22 +09:00
KUOKA Yusuke c9a43ad9cb
feat: Dependency locking (#593)
In order to maintain predictable deployments, as developer I want to generate and use "lock files" for all chart versions retrieved from a helmfile.

This change solves it by (1)enhancing `helmfile deps` to generate a lock file containing all the direct chart dependencies of each helmfile state file and
(2)making other helmfile sub-commands reads the lock file and merge the locked version numbers to the helmfile state file being processed.

The lock file is named after the helmfile state file being locked, so that you can have multiple set of the helmfile state file and the lock file pairs in a directory.

When `helmfile deps` are not explicitly run before commands like `sync`, all the helmfile behavior should remain as before.

Let's say you have `helmfile.1.yaml`:

```
repositories:
- name: stable
  url: https://kubernetes-charts.storage.googleapis.com

releases:
- name: envoy
  chart: stable/envoy
- name: envoy2
  chart: stable/envoy
```

`helmfile deps` generates `helmfile.1.lock` that looks like:

```
dependencies:
- name: envoy
  repository: https://kubernetes-charts.storage.googleapis.com
  version: 1.5.0
digest: sha256:e43b05c8528ea8ef1560f4980a519719ad2a634658abde0a98daefdb83a104e9
generated: 2019-05-14T16:45:37.78205+09:00
```

Under the hood, `helmfile deps` creates a temporary local helm chart with a dummy `Chart.yaml` and `requirements.yaml` deduced from the `helmfile.yaml` content, then runs `helm dependency update` to produce od update the corresponding `requirements.lock` file.

`helmfile` then renames it to match the name of the targeted helmfile state file and moves it,  so that it becomes adjacent to each `helmfile.yaml`.

Other `helmfile` commands like `sync`, `diiff`, `apply`, `lint` read chart version numbers from the lock file.

Resolves #483
2019-05-15 09:39:12 +09:00
KUOKA Yusuke 870d33f418
fix: `helmfile delete` should not stop on uninstalled release(s) (#509)
Resolves #481
2019-03-29 10:11:19 +09:00
Yusuke KUOKA 9cfd6aeae7 Ensure helm-diff is installed for integration testing 2019-02-04 17:13:17 +09:00
Yusuke KUOKA 27da8a6b7a fix integration test 2019-02-04 15:15:56 +09:00
KUOKA Yusuke c6236a15bb
feat: Opt-out dep-builds and repo-updates (#463)
* Improve code organization

To make sure it is still readable after upcoming changes to helmfile

* feat: `helmfile deps` to update dependencies of all the local charts

Resolves #450

* feat: helmfile updates repos and build deps by default

But not update deps. Use `helmfile deps` to update deps, and provide `--skip-deps` to skip updating repos and builds deps in sync/diff/apply/template

Resolves #415

* Improve integration test coverage
2019-02-04 12:07:25 +09:00
Anatoly Rugalev d898dfbd0d Updated documentation related to deprecation of `context` directive (#403) 2018-11-27 14:12:40 -08:00
KUOKA Yusuke f23a43c80c
fix(ci,doc): follow up for default non-interactivity of helmfile (#375)
The integration test was failing due to that it was still using `--auto-approve` flag which was removed. The documentation was still refering to `--auto-approve` and had no explanation about the new `--interactive` flag. This fixes all these issues.

This a follow up for #368
See https://github.com/roboll/helmfile/pull/374#issuecomment-425291468 for more context.
2018-09-28 10:40:57 +09:00
Dan Helfman 1ade353c1a Use --namespace value within Helmfile template (#343)
* Use --namespace value within Helmfile template (#326).

* Tabs and spaces.

* Tab/spaces fix.

* Pacifying "go fmt".

* Hard-coding namespace in test convenience function.

* MR feedback: Add comment to exported identifier.

* MR feedback: Put comment in correct location.

* fix(ci): fix never-ending build issue by auto-approving `helmfile delete`
2018-09-17 21:28:45 +09:00
KUOKA Yusuke 2c36640ad2
To reduce integration test flakiness 2018-08-27 23:04:16 +09:00
Yusuke KUOKA 1a5558a306 fix(ci): Reduce flakiness
Fix #103
2018-07-25 11:21:01 +09:00
Cedric Meury 10255aecc7 retry curl to reduce risk of race condition 2018-04-29 22:13:16 +02:00
Cedric Meury e4c016142d add unit tests and upgrade minikube, helm and k8s; set automountServiceAccountToken for 2.9.0 compatibility 2018-04-28 00:19:01 +02:00
Cedric Meury 8912eef468 run integration tests against minikube on circleci 2018-04-05 04:44:35 +02:00
Cedric Meury 8bcdeed432 run an integration test script against minikube 2018-04-05 04:44:21 +02:00