Commit Graph

71 Commits

Author SHA1 Message Date
Ruslan d646b3cbd4
feat: Implement caching for pulling OCI charts (#2171)
Signed-off-by: Ruslan Khizhnyak <mustdiechik@gmail.com>
Co-authored-by: Ruslan Khizhnyak <rkhizhnyak@ptsecurity.com>
2025-09-13 12:49:03 +08:00
yxxhero 959aae5791
refactor(yaml): switch yaml library import paths from gopkg.in to go.yaml.in (#2114)
Signed-off-by: yxxhero <aiopsclub@163.com>
2025-08-01 11:28:39 +08:00
yxxhero e197a90597
build(helm) update to v3.18.0 (#2044)
* build(helm) update to v3.18.0

Signed-off-by: yxxhero <aiopsclub@163.com>
2025-05-21 16:57:36 +08:00
yxxhero b52ca9ae04
refactor(yaml): upgrade from gopkg.in/yaml.v2 to v3 (#2039)
* refactor(yaml): upgrade from gopkg.in/yaml.v2 to v3

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

* refactor(yaml): enhance yaml encoding with consistent formatting and quotes

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

* optimize code

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

* fix tests

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>

---------

Signed-off-by: yxxhero <aiopsclub@163.com>
2025-05-15 10:21:37 -04: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
yxxhero 5d29f03782
Remove all v0.x references (#1919)
* fix tests

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

* refactor(two_pass_renderer): remove unused imports and functions

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 tests

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 tests

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 tests

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 tests

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 tests

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 tests

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 tests

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 tests

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>

---------

Signed-off-by: yxxhero <aiopsclub@163.com>
2025-03-08 07:43:21 -06:00
yxxhero 63e2684ade
Revert "cleanup: remove all about v0.x" (#1918)
Revert "cleanup: remove all about v0.x (#1903)"

This reverts commit d7bcd5e998.

Signed-off-by: yxxhero <aiopsclub@163.com>
2025-02-08 18:25:16 +08:00
yxxhero d7bcd5e998
cleanup: remove all about v0.x (#1903)
* fix tests

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

* refactor(two_pass_renderer): remove unused imports and functions

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 tests

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 tests

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 tests

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 tests

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 tests

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 tests

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 tests

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 tests

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>

---------

Signed-off-by: yxxhero <aiopsclub@163.com>
2025-02-05 13:50:16 -05:00
yxxhero eebcca002c
fix: update acme chart URL in input.yaml (#1773) 2024-11-07 09:59:15 +08:00
xtphate a15a1b0731
Feature/support env hcl and interpolations (#1423)
* support HCL language for env variables

Signed-off-by: xtphate <65117176+XT-Phate@users.noreply.github.com>
2024-04-22 08:02:14 +08:00
Vladan Pavlovic 22c05f9ed9
feat: respect helmfile.lock with ad-hoc kustimzation (#1244)
* Resolve dependencies before releases are created

Signed-off-by: vlpav030 <vpav.030@gmail.com>

* Add test

Signed-off-by: vlpav030 <vpav.030@gmail.com>

---------

Signed-off-by: vlpav030 <vpav.030@gmail.com>
2023-12-27 19:25:30 +08:00
Felipe Santos 9596790a51
test: fix running tests locally (#1088) 2023-10-23 05:51:40 +08:00
Felipe Santos d58c664776
feat: add duration to failed releases summary (#1066)
Signed-off-by: Felipe Santos <felipecassiors@gmail.com>
2023-10-12 18:49:07 -05:00
Alessio Dionisi ad258463b6
feat: add an option to set a custom kustomize binary (#1012)
Signed-off-by: Alessio Dionisi <me@alessiodionisi.com>
2023-09-13 06:58:53 -05:00
yxxhero c3292f141c
fix snapshot tests random error (#985)
* fix snapshot tests random error

Signed-off-by: yxxhero <aiopsclub@163.com>
2023-08-22 21:00:10 -05:00
yxxhero 48e48aa568
feat: add friendly tips for helmfile config order (#710)
* feat: add kindful tips for helmfile config order

Signed-off-by: yxxhero <aiopsclub@163.com>
2023-08-06 22:22:36 +08:00
yxxhero aac734ffd5
fix re-using environment state in sub-helmfiles issue (#951)
* fix re-using environment state in sub-helmfiles issue

Signed-off-by: yxxhero <aiopsclub@163.com>
2023-08-06 21:49:55 +08:00
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
yxxhero c55fa0f765
Replace interface{} by any (#901)
Signed-off-by: yxxhero <aiopsclub@163.com>
2023-06-16 10:49:05 +09: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
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 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
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
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
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 36996df980 fix unit test
Signed-off-by: yxxhero <aiopsclub@163.com>
2022-11-24 21:05:16 +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
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 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