Commit Graph

178 Commits

Author SHA1 Message Date
yxxhero 85ade797ab
Use cobra (#234)
switch to cobra

Signed-off-by: yxxhero <aiopsclub@163.com>
2022-07-19 21:06:18 +09:00
yxxhero ac23def893 add Go lint
Signed-off-by: yxxhero <aiopsclub@163.com>
2022-07-16 20:21:11 +08:00
yxxhero 9b0293d9ea
fix within func issue (#209)
Signed-off-by: yxxhero <aiopsclub@163.com>
2022-07-05 17:50:43 +09:00
Yusuke Kuoka fc306ec3d1
Make a few helmfile sub-commands consistently support needs-related flags (#78)
* Make a few helmfile sub-commands to consistently support needs-related flags

* helmfile-diff adds support for --include-transitive-needs
* helmfile-template adds support for --skip-needs
* helmfile-lint adds support for --skip-needs, --include-needs, and --include-transitive-needs

Ref https://github.com/roboll/helmfile/issues/2055

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

* Fix a few helmfile-lint needs related bugs and add tests

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

* Is include-transitive-needs realy working as intended? 🤔

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

* Confirm that it does fail on unselected need by default

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

* Add missing testdata

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

* Test helmfile-template for include/skip needs support

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

* Fix a few terms

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

* Add more tests to better know the current helmfile-diff behavior around needs

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

* Fix failing tests

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

* Fix helmfile-diff to consistently handle skip/include-needs

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

* Extract testhelper.RequireLog for reusing

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

* Fix all bugs and test cases for TestDiff and TestDiff_2

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

* Fix TestDiff_2

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

* Fix TestDiff

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

* Fix TestDiffWithNeeds

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

* Unify behavior on including disabled releases as needs for lint and template

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

* Fix bug that --include-transitive-needs does not imply include-needs

Signed-off-by: Yusuke Kuoka <ykuoka@gmail.com>
2022-06-20 07:19:39 +09:00
Quan TRAN 577f54af7a
Introduce DISABLE_INSECURE_FEATURES to disable insecure command executions (#1)
* introduce DISABLE_INSECURE_FEATURES to disable insecure executions

Signed-off-by: Quan TRAN <account@itscaro.me>

* disable remote sources when DISABLE_INSECURE_FEATURES is set to "true"

Signed-off-by: Quan TRAN <account@itscaro.me>

* refactor envvar package

Signed-off-by: Quan TRAN <account@itscaro.me>

* (test) fix test fixtures

Signed-off-by: Quan TRAN <account@itscaro.me>

* use absolute path to avoid unit test failure

Signed-off-by: Quan TRAN <account@itscaro.me>

* Fix conflicts

Co-authored-by: Yusuke Kuoka <ykuoka@gmail.com>
2022-06-05 15:15:06 +09:00
yxxhero aaf2126f91 little code optimize
Signed-off-by: yxxhero <aiopsclub@163.com>
2022-06-05 12:58:55 +08:00
Quan TRAN a92c574a98
Merge pull request #112 from yxxhero/remove_unused_comments
remove unused comments
2022-05-30 23:12:19 +02:00
Quan TRAN 0cfef76f0d
Merge pull request #88 from chubchubsancho/validate_manifest_on_sync
feat: allow --validate on sync command
2022-05-30 10:11:53 +02:00
yxxhero 0c57129aab remove unused comments
Signed-off-by: yxxhero <aiopsclub@163.com>
2022-05-30 10:08:19 +02:00
austin ce eb3484d4a8
Rename module to github.com/helmfile/helmfile
Also updates a few more references to the roboll/helmfile repository,
where possible.

Signed-off-by: austin ce <austin.cawley@gmail.com>
2022-05-18 10:05:07 -04:00
Grégory SANCHEZ 62747378ca feat: allow --validate on sync command
This will permit usage of `--validate` options with sync command

Signed-off-by: Grégory SANCHEZ <gregory.sanchez@icloud.com>
2022-05-17 14:00:55 +02:00
Yusuke Kuoka 97e0ca73ca feat: Auto-detect term for coloring helm-diff output
Since helm-diff has added an ability to auto-detect the term to decide if it should output with color or not, helmfile had been defaulted to no-color.
This resoloves that, by adding a term-detection logic that is same as helm-diff.

As a part of this work, I have also implemented a new global flag `--color`, which is used for forcing color without relying on the term-detection logic implemented in helmfile or explicitly setting the HELM_DIFF_COLOR envvar. I hope it is useful for folks.

Ref https://github.com/roboll/helmfile/issues/2043

Signed-off-by: Yusuke Kuoka <ykuoka@gmail.com>
2022-04-06 02:38:36 +00:00
yxxhero 303ef9cd80 remove ioutil usage in all project
Signed-off-by: yxxhero <aiopsclub@163.com>
2022-04-03 15:53:19 +08:00
Anton Bretting b1928e585d
Stop panic when deduplicating releases (#2067)
* Stop panic when deduplicating releases
* Add testdata for new testcases
2022-03-10 18:57:58 +09:00
Anton Bretting 2f04831817
Fix various golangci-lint errors (#2059) 2022-02-12 20:28:08 +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
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
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
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
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 77e6268bcb
Add support for transitive dependencies. (#1983)
Co-authored-by: Peter Aichinger <petera@topdesk.com>
2021-10-20 17:55:08 +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
Yusuke Kuoka 97bab23e0c
Fix --skip-cleanup to work with chartify (#1860) 2021-05-24 08:30:58 +09:00
dudicoco 92ba347d6f
Add --skip-diff-on-install to helmfile diff (#1841)
* Add --skip-diff-on-install to helmfile diff
2021-05-16 14:02:53 +09:00
Yusuke Kuoka 212e6acf23
Fix helmfile-lint not to stop on fisrt error (#1836)
Fixes #1826
2021-05-09 13:33:36 +09:00
Yusuke Kuoka 794ab9fc66
Fix lint and status not to fail with selector and needs (#1834)
Fixes #1830
2021-05-08 21:23:09 +09:00
Yusuke Kuoka 08db073958
Fix broken selector and DAG calculation logic after --{include,skip}-needs addition with correct Release IDs (#1823)
#1772 broke `--selector` with `needs` in many ways.

The two biggest problems I've encountered were:

- duplicate releases even if you've provided a proper `selector` to deduplicate
- sync/deletion ordering broken when you have `needs`

For the first issue, we had to update `getSelectedReleases` function to also calculate the "selected releases and releases needed by the selected releases", and use that to calculate the DAG. That should have been done in #1772.

The latter started happening after I've fixed the first issue. The source of the issue was that `needs` turned out to be ambiguous in a few cases.

Previously, `needs: ["foo/bar"]` had two meanings. One for "needs release bar in kubecontext foo", another for "needs release bar in namespace foo".

Moreover, `needs: ["foo/bar/baz"]` had three meanings.

- `needs release baz in tiller namespace foo and namespace baz`
- `needs release baz in namespace bar in kubecontext foo`
- `needs release baz in tiller namespace bar in kubecontext foo`.

Especially, the first meaning doesn't make sense at all. Helm 2 solely use tillerNamespace for namespacing the release and Helm 3 uses namespace for that.

This fix sorts all the bugs and issues I've found so far around that, by changing the meanings of the above two examples as follows:

- `foo/bar` means `namespace=foo,name=bar` for Helm 3 and `tillerNamespace=foo,name=bar` for Helm 2
  - `needs release bar in kubecontext foo` is now `foo//bar`. Notice the extra `/` between `foo` and `bar`.
- `foo/bar/baz` means `kubecontext=foo,namespace=bar,name=baz` for Helm 3 and `kubecontext=foo,tillerNamespace=bar,name=baz` in Helm 2

Fixes #1818
2021-05-01 21:59:25 +09:00
Yusuke Kuoka de8644a504
Fix --selector results to correctly deduplicate releases (#1822)
Fixes #1818
2021-05-01 15:06:07 +09:00
katsew f28ad5af23
Fix defaulting and overriding kubeContext (#1814)
Ref #1810

* fix defaulting and overriding kubeContext

* make defaulting kubeContext side-effect free

* checkDuplicates should check releases with overriden values
2021-05-01 12:42:29 +09:00
Yusuke Kuoka 5a3bd7d649
Fix destory, delete, and test to work with chartify on local chart with dependencies that are not yet downloaded (#1801)
Fixes #1800
2021-04-24 20:50:16 +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 5d43b30a7c
Add --{include,skip}-needs to various helmfile commands (#1772)
* Add --{include,skip}-needs to helmfile-sync and helmfile-apply

* Add --include-needs to helmfile-template

* Add TODO related to #1018

* Add a few new test files to cover new functionalities

* Update apply test to incorporate the change that the destroy and sync steps target affected releases only
2021-04-20 23:06:51 +09:00
Yusuke Kuoka ae942c5288
Fix --skip-crds not working with chartify (#1774)
Follow-up for #1771
Ref #1770
Ref https://github.com/roboll/helmfile/pull/1771#issuecomment-817399338
2021-04-13 09:09:58 +09:00
Yusuke Kuoka a111e89b27
Add `--skip-crds` to `helmfile sync` and `helmfile apply` (#1771)
Resolves #1770
2021-04-11 10:38:23 +09:00
Yusuke Kuoka 1d7608f42c Fix `helmfile repos` to not fail with `forceNamespace`
Fixes #1752
2021-04-10 16:26:40 +09:00
Yusuke Kuoka 2ff06a8abd
Fix chartify to take --include-crds into account (#1761)
Fixes #1760
2021-04-08 10:06:34 +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
Yujun Zhang a161796dc4
feat: Allow overriding chart via flag (#1751)
Adds `--chart` flag for overriding the selected release's chart ad-hoc-ly like `helmfile --chart $CHART template`.
This is handy when e.g. you want to have an ArgoCD application per each release in your helmfile.yaml, while also providing the ability to customize the release's chart without touching helmfile.yaml.

See https://github.com/roboll/helmfile/issues/1690#issuecomment-812321354 for more context.

Closes #1690
2021-04-06 13:20:41 +09:00
Quan TRAN 53c6d2f988
Add helmfile-fetch command to downloading and generating charts (#1734) 2021-03-30 16:26:31 +09:00
Jason Witkowski 2618cfb38b
Enable --wait-for-jobs flag introduced in helm 3.5 (#1715)
Fixes #1650
Fixes #785

This change introduces:

- `--wait-for-jobs` CLI override option to helmfile binary
- `waitForJobs` helmDefaults parameter (default `false`)
- `waitForJobs` release parameter (default `false`)

Note that `--wait-for-jobs` was introduced in Helm 3.5 (https://github.com/helm/helm/pull/8363)
2021-03-23 16:53:57 +09:00
Quan TRAN 5ce755e4d8
Add chart & version to list cmd output (#1731) 2021-03-23 16:29:48 +09:00
Quan TRAN b7d6639b25
(fix) remove usage of charts.yaml in error message (#1732) 2021-03-23 16:27:51 +09:00
Jason Witkowski bd3838c059
Add ability to specify and override helmDefaults.wait via cli (#1678) 2021-02-24 12:47:27 +09:00
Yusuke Kuoka 1ef9b29f6d
Improve handling of releases being newly installed by helmfile-apply (#1618)
This improves helmfile-apply with two things:

- Some users had timing-out issues or annoyed by huge output from helm-diff run as part of helmfile-apply on first install. `--skip-diff-on-install` skips running helm-diff for releases being newly installed, so that you can avoid those issues.
- Some users had difficultly or found it not straight-forward to install CRDs and custom resources from separate charts in one helmfile-apply (#1353). The new helmfile.yaml release field `disableValidationOnInstall: true` adds `--disable-validation` to helm-diff only for releases being newly released, which should mostly resolve the issue.

Resolves #1353
2020-12-11 09:09:35 +09:00
Wi1dcard 4e485219d7
Fix the logic of helmfile deps and add tests. (#1588) 2020-11-19 09:29:59 +09:00
Yusuke Kuoka 88884b68dc
feat: `helmfile template --skip-cleanup` (#1570)
* feat: `helmfile template --skip-cleanup`

Resolves #1517
2020-11-06 09:23:49 +09:00
Yusuke Kuoka 5a15b65b94
feat: Add `helmfile apply --skip-cleanup` (#1571)
This deprecates the old `--retain-values` which was not working as intended.

Also see #1570 - there's now `--skip-cleanup` for `helmfile-template`, too.
2020-11-05 10:18:30 +09:00
Yusuke Kuoka 6b86408500
feat: Add `helmfile template --include-crds` (#1568)
This allows you to use helmfile-template output as a GitOps source, when the template output contains CRDs and you use Helm 3.

Helm 3 by default removes CRDs from the template output. If you want to git-commit helmfile-template containing CRDs for GitOps and you use Helm 3 for templating, the only way is provide this newly added `--include-crds` flag.
2020-11-05 10:13:25 +09:00
Yusuke Kuoka 87e86dcfd2
Fix `helmfile --selector x=y template` with `needs` (#1564)
I had mistakenly inverted the necessary flag to turn off the legacy processing on selectors that should be used only for helmfile commands that does not support DAGs/needs.

Fixes #1552
2020-11-04 09:29:23 +09:00
Yusuke Kuoka c170b5a621
Minor tweaks for `helmfile write-values` (#1533)
See 1 and 3 in https://github.com/roboll/helmfile/issues/1460#issuecomment-691863465
2020-10-13 09:33:49 +09:00
Yusuke Kuoka 3018e82902
Fix multiple --set in --args messed up in `helmfile template` (#1529)
Fixes #1520
2020-10-13 08:38:06 +09:00
Yusuke Kuoka b176408eb2
Enable `helmfile test` testing only enabled and selected releases (#1486)
Resolves #1483
2020-09-21 09:44:05 +09:00
Yusuke Kuoka 0fad9f0544
Add experimental write-values command for writing values files only (#1469)
Ref #1460
2020-09-11 22:19:36 +09:00
Yusuke Kuoka 3e6542e341
Fix test flake for `commonLabels` (#1449)
Ref https://github.com/roboll/helmfile/pull/1415#issuecomment-684139831
2020-09-01 10:52:08 +09:00
Yusuke Kuoka cd0ecc5263 Fix build error after `helmfile build --embed-values` addition
This is a follow-up for #1436
2020-08-29 15:01:22 +09:00
Yusuke Kuoka 0fc0869671
feat: `helmfile build --embed-values` to embed release values and secrets into the output (#1436) 2020-08-29 13:18:17 +09:00
Maksym Lushpenko 5ca7ce15bc
feat: common labels for all releases in a helmfile (#1415)
This adds `comonLabels` option to helmfile by:

- Adding `CommonLabels` to HelmState
- Changing `markExcludedReleases` and `ListReleases` functions to merge common labels into release labels

Resolves #1266
2020-08-29 13:14:58 +09:00
Yusuke Kuoka 14e2b9ed93
Fix regression in helmfile deps (#1431)
Fixes #1421
2020-08-27 09:22:02 +09:00
KUOKA Yusuke 0ef7e65f02
Fix race on/sometimes missing postsync and cleanup hooks (#1407)
So that those hooks are fully executed as intended. The documentation about hooks are updated as well to clarify the intended behaviour.

Fixes #1398
2020-08-08 16:45:21 +09:00
KUOKA Yusuke b85243a6b4
Fix various issues in chart preparation (#1400)
In #1172, we accidentally changed the meaning of prepare hook that is intended to be called BEFORE the pathExists check. It broke the scenario where one used a prepare hook for generating the local chart dynamically. This fixes Helmfile not to fetch local chart generated by prepare hook.

In addition to that, this patch results in the following fixes:

- Fix an issue that `helmfile template` without `--skip-deps` fails while trying to run `helm dep build` on `helm fetch`ed chart, when the remote chart has outdated dependencies in the Chart.lock file. It should be up to the chart maintainer to update Chart.lock and the user should not be blocked due to that. So, after this patch `helm dep build` is run only on the local chart, not on fetched remote chart.
- Skip fetching chart on `helmfile template` when using Helm v3. `helm template` in helm v3 does support rendering remote charts so we do not need to fetch beforehand.

Fixes #1328
May relate to #1341
2020-08-06 09:06:25 +09:00
KUOKA Yusuke 53c3fe9f37
Add support for selector on `helmfile template` (#1399)
Fixes #1377
2020-08-05 09:31:58 +09:00
KUOKA Yusuke 85a2024669
Fix `helmfile lint` failure when `installed: false` (#1391)
Fixes #1344
2020-08-01 13:47:57 +09:00
KUOKA Yusuke 87573089e8
Fix false-positive duplicate release with kubeContext (#1390)
Helmfile has been incorrectly showing releases with the same name but in different kubeContexts as duplicates. This fixes that.
2020-08-01 12:12:54 +09:00
KUOKA Yusuke 1e260e4a5e
Fix and enhancement to repository update (#1383)
Changes:

- Prevent Helmfile from unnecessarily running `helm repo add` and `helm repo up` against repositories for unused repositories(repositories of releases filtered out by selector)
- Fixes #1330
2020-07-28 10:17:43 +09:00
KUOKA Yusuke 1e956ae8a5
Fix list failure when patches are used (#1371)
Fixes #1368
2020-07-22 22:33:45 +09:00
KUOKA Yusuke df6489ab43
feat: `helmfile template --output-dir-template` for customizing output dirs (#1357)
This is useful for e.g. removing state file names and their hash values out of output dirs so that it can be used easily in a gitops setup. For example, `--output-dir-template mybasedir/{{.Release.Name}}` produces `mybasedir/RELEASE/CHART/templates/*.yaml` for each release in your helmfile.yaml.
2020-07-16 09:02:26 +09:00
KUOKA Yusuke 3a2a460fe7
Do cleanup decrypted env secrets files (#1304)
* Do cleanup decrypted env secrets files

Resolves #503
2020-06-16 08:59:48 +09:00
Max Audron f16d96bc8f
Add global hooks (#1301)
Changes:

* Add global hooks
* Add top level hooks field to yaml spec
* Add functions for global prepare and cleanup events
* Call global prepare and cleanup events in withPreparedCharts function
* Update README
* Add helmfileCommand variable to withPreparedCharts
  Pass the information on what helmfileCommand has been run down from the
  top level functions through withReposAndPreparedCharts and withPreparedCharts.
2020-06-11 10:05:38 +09:00
Kevin J. Qiu 0f86cc9b87
Add the ability to load a remote environment values file (#1296)
Enables the user to specify a remote path for an environment values file, e.g.,

```yaml
environments:
  cluster-azure-us-west:
    values:
      - git::https://git.company.org/helmfiles/global/azure.yaml?ref=master
      - git::https://git.company.org/helmfiles/global/us-west.yaml?ref=master
  cluster-gcp-europe-west:
    values:
      - git::https://git.company.org/helmfiles/global/gcp.yaml?ref=master
      - git::https://git.company.org/helmfiles/global/europe-west.yaml?ref=master

releases:
  - ...
```

This is particularly useful when you co-locate helmfiles within your project repo but want to reuse the definitions in a global repo.
2020-06-11 10:04:01 +09:00
Ilya Vassyutovich 28e13c3a18
typo: Fix message for detected diff (#1284) 2020-06-06 09:31:25 +09:00
KUOKA Yusuke eff2a7bf84
Fix repo update timing (#1287)
Fixes #1283
2020-05-30 18:01:14 +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
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
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
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
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
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
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 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 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 bf22502a2f
feat: add helmfile template --validate (#1135)
This adds the ability for helmfile to call `helm template --validate` introduced in helm 3.

fixes #1105
2020-03-05 08:07:02 +09:00
KUOKA Yusuke af44965949
feat: `helmfile --log-level=debug apply --retain-values-files` (#1127)
`--retain-values-files` prevents temporary values files that were passed to Helm commands run by Helmfile for debugging purpose.

With that, you can manually rerun helm commands that were logged when `--log-level=debug` is enabled.

Resolves ##1117
2020-02-28 19:39:01 +09:00
KUOKA Yusuke 0186254e79
feat: --detailed-exitcode for `helmfile apply` (#1120)
Resolves #1113
2020-02-26 21:09:05 +09:00
KUOKA Yusuke f1bdb65777
fix: delete/destroy ordering within directory (#1119)
Fixes #979
2020-02-25 09:46:01 +09:00
Emil 05add478c1
Add option to suppress diff on apply (#1092)
* Add option to suppress diff on apply

Add --supress-diff option on apply. Usable for fresh installs when a
lot of output is produces by diff.

Resolves #458

* fix tests for suppress-diff
2020-02-05 21:29:55 +09:00
Christoph Hösler 9fab6851f0
fix test command for helm 3 (#1080) 2020-02-03 08:41:38 +09:00
KUOKA Yusuke 468b9b659d
Fix random "expansion errors" in large values contained in `values` (#974)
Those are not actually random but would have looked like so. We use an external go pkg `variantdev/vals` to expand urls like `ref+vault://foo/bar` contained in release values into their respective secret values.

There was a bug in `vals` that it tries to expand unintended types of strings which resulted in confusing errors like reported in #973.

`vals` fixed the issue in ba4c7a2987. This commit upgrades `vals` to accomodate that.

Fixes #973
2019-11-17 09:37:45 +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 a136c46c06 fix the bug that `helmfile template` is unable to render anything when `--namespace` is specified 2019-11-07 21:23:36 +09:00
Yusuke Kuoka e2e4e8440d fix the bug that resulted in `helmfile sync` not delete releases with `--namespace` 2019-11-07 20:48:55 +09:00
Yusuke Kuoka 77082cef58 fix regression that `--namespace` breaks delete/destroy and possibly sync/apply as well
The problem was that `--namespace NS` had been not taken into account while deleting releases, that resulted in releases that should be deleted are not deleted.
2019-11-07 19:53:27 +09:00
Yusuke Kuoka 8d7c79a323 fix: release not found on uninstall through sync/apply
The recent addition of the DAG support(`needs`) and the fixes on it broke the delete-on-sync functionality. And there were two more bugs. One is that it was not correctly running `helm delete` when needed and the another is that it was failing when `--selector` is specified and the releases to delete by sync found, but nothing actually got deleted. This fixes all of them.

Fixes #941
2019-11-07 10:09:54 +09:00
KUOKA Yusuke ed7a6d9051
Port the `needs` fix for `helmfile apply` to `sync`, and make `template` DAG-aware (#940)
This ports the fix for `helfmile apply` to `sync`, so that specifying `--selector` doesn't break `helmfile sync`.

Also make `helmfile template` DAG-aware, so that the manifests are rendered in the order of dependency.

Ref #919
2019-11-06 23:16:57 +09:00
Yusuke Kuoka ebad0ad20f Remove unnecessary code 2019-11-06 22:30:08 +09:00
Yusuke Kuoka 4751613f39 Port the fix for `needs` to `helmfile delete` and `destroy`
This ports the fix for `helfmile apply` to `delete` and `destroy`, so that specifying `--selector` does not break those commands anymore.

Ref #919
2019-11-06 22:27:53 +09:00