Commit Graph

46 Commits

Author SHA1 Message Date
yxxhero dd11bcfe93 feat(state): add missingFileHandlerConfig and related logic
Signed-off-by: yxxhero <aiopsclub@163.com>
2025-07-19 17:19:23 +08:00
yxxhero c3864a45d3
feat: add --take-ownership flag to helm diff and related config (#1992)
* feat: add --take-ownership flag to helm diff and related config

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

* fix: nil issue

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

* fix tests

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

* fix tests

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

* fix more issue

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

* fix more issues

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

* fix tests

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

* add more tests

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

---------

Signed-off-by: yxxhero <aiopsclub@163.com>
2025-04-27 12:57:41 -04:00
yxxhero e4273d050e
feat: add labels for helm release (#1046)
feat: add labels for k8s resources

Signed-off-by: yxxhero <aiopsclub@163.com>
2025-03-30 19:24:41 -04:00
Connor Hindley 2c38611acd
feat: Add support for --wait-retries flag. (#1922)
* feat: Add support for --wait-retries flag.

This change wires up waitRetries option to set the helm --wait-retries flag.

--wait-retries was added in helm 3.15.0 and makes waiting more robust to registry errors.
https://github.com/helm/helm/commit/fc74964
https://github.com/helm/helm/releases/tag/v3.15.0

Resolves #1522

Signed-off-by: Connor Hindley <connor.hindley@tanium.com>
2025-02-12 07:28:37 +08:00
Adam Blasko 524636c0a8
fix: using correct option for takeOwnership flag (#1892)
Fixed test to correctly assert the new flag

Signed-off-by: Adam Blasko <adam.blasko1@gmail.com>
2025-01-23 08:30:39 +08:00
yxxhero 22ad21c1ae
feat: add --take-ownership flag to apply and sync commands (#1863)
Signed-off-by: yxxhero <aiopsclub@163.com>
2025-01-11 08:41:10 -06:00
Zubair Haque d1416ec7b4
feat: add skip json schema validation during the install /upgrade of a Chart (#1737)
* open PR for --skip-schema-validation flag

Signed-off-by: zhaque44 <haque.zubair@gmail.com>
2024-10-24 20:53:18 +08:00
yxxhero 5c6572b492
Add hide notes support (#1710)
* add --hide-notes support

Signed-off-by: yxxhero <aiopsclub@163.com>
2024-09-17 20:24:19 +08:00
jim-barber-he f73da1e2a1
Add helmfile template --show-only (#1494)
Add a `--show-only` parameter to the `helmfile template` command to pass
on to the `helm template` command.

Signed-off-by: Jim Barber <jim.barber@healthengine.com.au>
2024-05-12 07:02:02 +08:00
yxxhero 9203641f03
feat: add suppress output line regex support (#1329)
* feat: add suppress output line regex support

Signed-off-by: yxxhero <aiopsclub@163.com>
2024-02-18 12:10:14 +08:00
Maarten Boekhold d0b8d7ee5e
Add "PostRendererArgs" option to be passed to helm (#1133)
* Add "PostRendererArgs" option to be passed to helm

This allows using PowerShell scripts on Windows as Post Renderer.

Signed-off-by: Maarten Boekhold <maarten.boekhold@finastra.com>
2023-11-21 21:32:14 +08:00
yxxhero a371e41960
optimize flag logic about wait (#1051)
* optimize flag logic about wait

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

* fix tests

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

* add units

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

* fix little issues

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

---------

Signed-off-by: yxxhero <aiopsclub@163.com>
2023-10-19 07:32:00 -05:00
yxxhero ee86032f0a
bump helm to v3.12.1 (#899)
Signed-off-by: yxxhero <aiopsclub@163.com>
2023-06-15 11:12:41 +08:00
yxxhero 00dace9b63
Feat add cascade support (#860)
* feat: add cascade support for helm v3.12.0

Signed-off-by: yxxhero <aiopsclub@163.com>
2023-05-15 13:49:33 +08: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 2d9f83c1de
clean: optimize postrenderer code (#738) 2023-03-14 06:18:20 +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
xiaomudk c4eb62388b
Drop Helm v2 support (#613)
Resolves #589

Signed-off-by: xiaomudk <xiaomudk@gmail.com>
2023-01-17 09:24:47 +09:00
yxxhero 36c91c5427
optimize lint logic (#586)
Signed-off-by: yxxhero <aiopsclub@163.com>
2022-12-18 08:39:45 +08:00
yxxhero ecc8988f10
clean: optimize post-render code (#577)
Signed-off-by: yxxhero <aiopsclub@163.com>

Signed-off-by: yxxhero <aiopsclub@163.com>
2022-12-14 22:06:23 +08: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
yxxhero 8690d63401 fix lint error
Signed-off-by: yxxhero <aiopsclub@163.com>
2022-08-13 07:40:32 +08: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
Quan TRAN 88127d641b [fix] chartify process when chart path is absolute
Signed-off-by: Quan TRAN <account@itscaro.me>
2022-04-11 23:34:52 +02:00
Anton Bretting 2f04831817
Fix various golangci-lint errors (#2059) 2022-02-12 20:28:08 +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 f38958d6d7
Fix cache path issue on Windows (#1846) 2021-05-13 09:00:43 +09:00
Yusuke Kuoka 204f78c8ff
Fix --set and --set-file flags are not passed to chartify (#1803)
Fixes #1681
Ref 286ed08a27
2021-04-24 22:27:53 +09:00
Yusuke Kuoka ce6a621414
Bump chartify to 0.8.3 to fix it not to break when two or more releases sharing the same chart and the namespace, but kubeContext (#1799)
Fixes #1695
2021-04-24 19:03:13 +09:00
Yusuke Kuoka 81b04fcb8b Add support for adhoc dependency to local chart
Helmfile has been providing a feature called "adhoc chart dependency" that basially enabled you to add Chart.yaml `dependencies` entry adhocly without forking or modifying the chart.

It was missing the support for using a local chart as the adhoc dependency. This patch adds that.

Usage:

`releases[].dependencies[].chart` is enhanced to accept the fs path to the local chart:

```
releases:
- name: foo
  chart: ./path/to/foo
  dependencies:
  - chart: ./path/to/bar
```

Resolves #1762
2021-04-10 16:09:27 +09:00
Yusuke Kuoka f614e8b1bf
feat: Helmfile renders *.yaml.gotmpl in a K8s manifests/kustomization directory (#1745)
Related to #494

This feature is mostly a built-in alternative to the `incubator/raw` chart without external dependency and has
access to helmfile's own template functions and template data.

The expected use-case of this feature is to add arbitrary K8s resources to your deployment.

Unlike the original issue raised in #494 this doesn't enable you to add arbitary resources to a release. That's another story. But this would be a good foundation for that, too.
2021-04-06 14:22:34 +09:00
Yusuke Kuoka f24b61f100
Fix error on concurrent go-getter on same URL (#1669)
Fixes #1660
2021-02-05 09:02:21 +09:00
Yusuke Kuoka b910591e1d
Add support for Kustomize Transformers (#1592)
Please see the updated `advanced-features.md` for more details.

This is often used for adding common labels and annotations to any resources rendered from a Helm chart.
2020-11-19 09:33:05 +09:00
mdaisuke 954673d742
Fix: forceNamespace needs shouldRun is true (#1510) 2020-10-02 08:27:39 +09:00
Yusuke Kuoka 19d79427a1
Add experimental "forceNamespace" in helmfile.yaml (#1444)
This is an experimental feature to support a potential use-case that you need to set namespaces in manifests rendered by `helmfile template`, WHEN the chart is unconventional hence does not have `namespace: {{ .Namespace }}`.
Rather than using this, you should usually fork/maintain or update/pull-request the chart to have `namespace: {{ .Namespace }}`.
Use this only when you CAN NOT do so, but still need to use `helmfile template`.
2020-09-01 10:13:27 +09:00
Joshua Hansen 7b11ce851a
feat: Allow .Release.Name to be used in gotmpl values templates (#1424)
This adds the ability to utilize `.Release` inside of gotmpl files as discussed [here](https://github.com/roboll/helmfile/issues/760).

Resolves: https://github.com/roboll/helmfile/issues/760

Co-authored-by: Yusuke Kuoka <ykuoka@gmail.com>
2020-08-29 13:07:46 +09:00
KUOKA Yusuke 2710cb382f
Fix go-getter URL in chart to actually work (#1405)
Fixes #1401
2020-08-08 11:01:47 +09:00
KUOKA Yusuke b5830a3011
Add ability to use go-getter for fetching remote manifests directory as chart (#1374)
This, in combination with #1172, allows you to use `go-getter`-supported URL for K8s manifests on `chart`, so that Helmfile automatically fetches it and then turning it into a temporary local chart, which is then installed by Helmfile as similar as standard Helm charts.

An example usecase of this is to install cert-manager CRDs which is distributed separately from the chart:

```
releases:
- name: cert-manager-crds
  chart: git::http://github.com/jetstack/cert-manager.git@deploy/crds?ref=v0.15.2
```

I'm adding this based on discussion with @lukasmrtvy. He was trying to install cert-manager and prometheus-opreator with Helmfile, and this combined with #1373 should do the job. Thanks for the input!
2020-07-23 00:30:16 +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
KUOKA Yusuke ca844aa044
Fix patching not using release namespace (#1300)
Ref #1299
2020-06-09 16:40:13 +09:00
KUOKA Yusuke 63c8df9873
Fix missing resources in `hemlfile template` with jsonPatches (#1290)
Probably this has been affecting strategicMergePatches and dependencies as well, as the source of the problem is the underlying common feature called helm-x that previsouly used `helm template --output-dir`, which turned out to be not working as intended.

Ref #1279
2020-06-01 22:54:11 +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
Yusuke Kuoka 68432b1848 fix: Do not skip passing values files when adhocDependencies/jsonPatches/jsonPatches exist
This is a follow-up for #1172
2020-05-27 21:13:05 +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
Marc Sutter 4166b418c9 feat: Adopt existing K8s resources as Helm release on install (#746)
Use with the helm-x support(#673)

This enhances config syntax to accept adopt: [NS/KIND/RESOURCE_NAME] at the release level so that helmfile calls helm-x to transparently import existing resources at the installation time.

Resolves #84
2019-07-11 09:13:34 +09:00
KUOKA Yusuke 1da3488599
feat: experimental integration with helm-x (#673)
This enhances helmfile so that it can:

- Treat K8s manifests directories and Kustomize projects as charts
- Add adhoc chart dependencies on sync/diff/template without forking or modifying chart(s) (#649)
- Add adhoc patches(JSON Patch or Strategic Merge Patch supported) to be applied to the K8s resources before sync/diff/template, without forking or modifyin chart(s) (#650)

The usage is as outlined in https://github.com/mumoshu/helm-x/tree/master/examples/helmfile.

Add any or all of `dependencies:`, `jsonPatches:` and `strategicMergePatches:` so that it adds additional flags to `helm` calls that is only supported by `helm x`.

```yaml
releases:
- name: kustomize
  chart: ../kustomize
- name: manifests
  chart: ../manifests
- name: foo
  chart: incubator/raw
  dependencies:
  - alias: bar
    chart: incubator/raw
  values:
  - values.yaml
  - bar:
      enabled: true
      resources:
      - apiVersion: v1
        kind: Pod
        metadata:
          name: bar
        spec:
          containers:
          - command:
            - sleep
            - 1000
            image: alpine:3.9.4
            imagePullPolicy: IfNotPresent
            name: bar
  jsonPatches:
  - target:
      version: v1
      kind: Pod
      name: foo
    patch:
    - op: replace
      path: /spec/containers/0/command
      value:
      - sleep
      - "123"
  strategicMergePatches:
  - apiVersion: v1
    kind: Pod
    metadata:
      name: bar
    spec:
      containers:
      - name: bar
        command:
        - sleep
        - "234"
```

You can alternatively provide `source: path/to/patch.yaml` for `jsonPatches` and `strategicMergePatches` items to externalize it. Add `.gotmpl` suffix like you would do for values files for templating.

When running `helmfile` you must point `--helm-binary` to the `helm-x` binary like below:

```
$ helmfile --helm-binary ~/.helm/plugins/helm-x/bin/helm-x --log-level debug apply
```

after installing the [helm-x](https://github.com/mumoshu/helm-x) plugin.

The integration should ideally be automatic. That is, it shouldn't force you to set `--helm-binary`. But I had no other way to not bloat helmfile's codebase to just add this experimental feature.

Resolves #649
Resolves #650
2019-06-12 16:11:34 +09:00