Commit Graph

70 Commits

Author SHA1 Message Date
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
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 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
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
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