Commit Graph

817 Commits

Author SHA1 Message Date
Eduardo Naves 430677d43c
Fix the password display problem when passing the chart link (#1281)
* Fix the password display problem when passing the
chart link

Signed-off-by: Eduardo Naves <eduardonaves41@gmail.com>
2024-01-24 09:01:04 +08:00
yxxhero 67dc49d193
feat: bump helm to 3.14.0 (#1295) 2024-01-20 05:35:50 +08:00
yxxhero 008b2dd1d4
fix: issue with pre-release Helm version (#1293) 2024-01-18 09:21:15 +08:00
coderkou f66fbd7c84
Bump helm diff to 3.9.2 (#1291) 2024-01-17 22:52:12 +08:00
yxxhero 09aced6cb0
feat: bump helm-diff to v3.9.1 (#1286) 2024-01-14 09:33:15 +08:00
ennekein dabbe5e7d4
Bugfix: do not print registry password to stdout when running (#1275)
* Bugfix: do not print registry password to stdout when running
Resolves #1274

Signed-off-by: Pascal Rivard <privard@rbbn.com>

* Update exec.go

Signed-off-by: yxxhero <11087727+yxxhero@users.noreply.github.com>

* fix lint issues

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

* Add unit test

Signed-off-by: Pascal Rivard <privard@rbbn.com>

---------

Signed-off-by: Pascal Rivard <privard@rbbn.com>
Signed-off-by: yxxhero <11087727+yxxhero@users.noreply.github.com>
Signed-off-by: yxxhero <aiopsclub@163.com>
Co-authored-by: Pascal Rivard <privard@rbbn.com>
Co-authored-by: yxxhero <11087727+yxxhero@users.noreply.github.com>
Co-authored-by: yxxhero <aiopsclub@163.com>
2024-01-10 07:26:47 +08:00
yxxhero 3576e7d36b
feat: include func support more template functions (#1277) 2024-01-09 14:33:50 +08:00
petelock 00dc5d9116
fix checker error message (#1266)
Signed-off-by: petelock <pete2387@gmail.com>
2024-01-04 17:31:00 +08:00
Shane Starcher d681c62ff8
add support for HELMFILE_FILE_PATH envvar to set -f (#1255)
* fix imports

Signed-off-by: Shane Starcher <shanestarcher@gmail.com>

* unset env var

Signed-off-by: Shane Starcher <shanestarcher@gmail.com>

---------

Signed-off-by: Shane Starcher <shanestarcher@gmail.com>
2024-01-03 21:37:49 +08:00
Seonghoi Lee 4871a92b8c
fix: prevent preparing chart for disabled releases (#1210)
* fix: prevent preparing chart for disabled releases

Previously, PrepareCharts does not filter any releases whose condition
is disabled with no selectors.

Prevent following things from
- using any unnecessary computing resources for disabled charts
- throwing any error from wrong configurations for disabled charts

Signed-off-by: Seonghoi lee <mighty1231@gmail.com>

* fix: working for integration test about list and build

Some tests require that PrepareCharts without any selector
may not add any labels on the release.

make markExcludedReleases do not add any label without any selectors

Signed-off-by: Seonghoi lee <mighty1231@gmail.com>

* fix: prevent resolved chart version loss

State loss the resolved chart version info from st.Releases
when st.GetSelectedReleases() be called

update st.Releases after st.GetSelectedReleases() in prepareCharts

Signed-off-by: Seonghoi lee <mighty1231@gmail.com>

* fix: preserve resolved version from resolveDeps

In PrepareCharts, the version, resolved from resolveDeps,
is removed after invoking GetSelectedReleases.

Do updateDeps at the first before GetSelectedReleases call

Signed-off-by: Seonghoi lee <mighty1231@gmail.com>

---------

Signed-off-by: Seonghoi lee <mighty1231@gmail.com>
2024-01-02 08:56:07 +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
yxxhero e99cde01ce
bump helm version to 3.13.3 (#1225)
Signed-off-by: yxxhero <aiopsclub@163.com>
2023-12-14 10:26:17 +08:00
yxxhero cb6b91c5dc
fix: ConditionEnabled panic issue (#1221) 2023-12-13 15:04:20 +08:00
Cyril Jouve eb21377f39
replace custom diff in tests using testify (#1215) 2023-12-13 06:32:38 +08:00
Cyril Jouve e0f1f765c5
simplify multierr usage with standard errors (#1208) 2023-12-10 20:04:05 +08:00
Cyril Jouve 9f2264ce24
consistently use Masterminds/semver (#1209) 2023-12-10 19:05:07 +08:00
Tunahan Sezen c731227e9a
fix: --state-values-set unable to set booleans (#1199)
This pr fixes auto-wrapping of booleans and integers into quotes when using --state-values-set by:

- Adding: --state-values-set-string flag for intentional string set of boolean or integer
- Changing: --state-values-set flag not wrapping now
- Removing -

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

Signed-off-by: Tunahan Sezen <sezentunahan@outlook.com>
2023-12-08 21:42:40 +08:00
Oleksandr Vorona 29caac793e
Allow secrets to be excluded from release template inheritance (#1189)
* Allow secrets to be excluded from inheritance, small docs update

Signed-off-by: Alex Vorona <alex@vorona.com.ua>

* Fix typo in docs

Signed-off-by: Alex Vorona <alex@vorona.com.ua>

---------

Signed-off-by: Alex Vorona <alex@vorona.com.ua>
2023-12-05 18:17:48 +08:00
Virgínia Tavares b10692dc9b
Create DeleteWait and DeleteTimeout parameters for Destroy (#1177)
* Create DeleteWait and DeleteTimeout parameters

Signed-off-by: Virginia Tavares <briosovirginia@gmail.com>

* Create tests for deleteWait and deleteTimeout

Signed-off-by: Virginia Tavares <briosovirginia@gmail.com>

* build(deps): bump github.com/aws/aws-sdk-go from 1.48.6 to 1.48.7 (#1176)

Bumps [github.com/aws/aws-sdk-go](https://github.com/aws/aws-sdk-go) from 1.48.6 to 1.48.7.
- [Release notes](https://github.com/aws/aws-sdk-go/releases)
- [Commits](https://github.com/aws/aws-sdk-go/compare/v1.48.6...v1.48.7)

---
updated-dependencies:
- dependency-name: github.com/aws/aws-sdk-go
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* Update temp_test.go with DeleteWait and DeleteTimeout

Signed-off-by: Virginia Tavares <briosovirginia@gmail.com>

* Create deleteWait function in state.go

Signed-off-by: Virginia Tavares <briosovirginia@gmail.com>

* Fix comments from review

Signed-off-by: Virginia Tavares <briosovirginia@gmail.com>

---------

Signed-off-by: Virginia Tavares <briosovirginia@gmail.com>
Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: Virginia Tavares <virginia.tavares@ericsson.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-12-05 08:38:37 +08:00
yxxhero 7d6ed97333
feat: include func support (#1187)
* feat: include func support

Signed-off-by: yxxhero <aiopsclub@163.com>
2023-12-04 21:51:01 +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 0199b5f764
fix checker for empty array case (#1153) 2023-11-20 16:34:24 +08:00
yxxhero 26f89e7e5d
bump helm to 3.13.2 (#1130)
Signed-off-by: yxxhero <aiopsclub@163.com>
2023-11-12 11:03:09 +08:00
flabatut b8a729d8c4
fix: support large output with --enable-live-ouput (#1139)
* fix: support large output with --enable-live-ouput

This replaces Scanner with ReadString to handle large amount of data returned by helm ouptut when executing diff action

- Changing pkg/helmexec/runner_test.go TestLiveOutput test, adding test with large amount of data, reproducing the issue before applying this fix
- Changing pkg/helmexec/runner.go Scanner with Readstring

Resolves https://github.com/helmfile/helmfile/issues/893

Signed-off-by: Franck Labatut <franck.labatut@ubisoft.com>

* fix: prevent data race

Signed-off-by: Franck Labatut <franck.labatut@ubisoft.com>

---------

Signed-off-by: Franck Labatut <franck.labatut@ubisoft.com>
2023-11-12 06:45:08 +08:00
Cyril Jouve 66935c4080
resolved deps even when installed=false (#1120)
fix #1119
revert #1054

Signed-off-by: Cyril Jouve <jv.cyril@gmail.com>
2023-11-09 12:02:32 +08:00
yxxhero 5e65669463
fix: args ignore in diff subcommand (#1118) 2023-11-04 09:23:36 +08:00
yxxhero 0c3951097e
fix #1095 (#1100)
* fix #1095

Signed-off-by: yxxhero <aiopsclub@163.com>
2023-11-01 11:55:55 +08:00
yxxhero 54da9dab87
fix chartify with non-chart dir (#1105)
* fix chartify with non-chart dir

Signed-off-by: yxxhero <aiopsclub@163.com>
2023-10-31 13:45:10 +08:00
yxxhero 34ccbf9056
fix issue 1093 (#1094) 2023-10-25 10:42:47 +08:00
yxxhero 98c4aec0d4
add more tests for Desired func (#1082)
Signed-off-by: yxxhero <aiopsclub@163.com>
2023-10-22 20:49:18 +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
xiaomudk 2c3bebb451
feat: support most remote urls (#1061)
* feat: support most remote urls

This adds support for s3:// http:// https:// and most other go-getter style urls by

- Adding http downloader
- Adding s3 downloader that authenticates with aws sdk shared credentials
- Changing the parser to accept remote formats that do not include '::'
- Removing validation that required go-getter urls to contain '@' which is not required by go-getter spec

Resolves #831

Signed-off-by: joshwoodcock <ltdwoodcock@gmail.com>

* Fix nil region

Signed-off-by: Josh Woodcock <b.woodcock@partner.samsung.com>

* fix golangci

Signed-off-by: xiaomudk <xiaomudk@gmail.com>

* fix testcase error

Signed-off-by: xiaomudk <xiaomudk@gmail.com>

* optimize code

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

* fix handle error

Signed-off-by: zhuxixi179 <zhuxixi179@hellobike.com>

---------

Signed-off-by: joshwoodcock <ltdwoodcock@gmail.com>
Signed-off-by: Josh Woodcock <b.woodcock@partner.samsung.com>
Signed-off-by: xiaomudk <xiaomudk@gmail.com>
Signed-off-by: yxxhero <aiopsclub@163.com>
Signed-off-by: zhuxixi179 <zhuxixi179@hellobike.com>
Co-authored-by: joshwoodcock <ltdwoodcock@gmail.com>
Co-authored-by: Josh Woodcock <b.woodcock@partner.samsung.com>
Co-authored-by: yxxhero <aiopsclub@163.com>
Co-authored-by: zhuxixi179 <zhuxixi179@hellobike.com>
2023-10-17 18:48:04 -05:00
yxxhero c1c1ad45bd
feat: bump helm version to 3.13.1 of tests (#1068) 2023-10-16 18:08:52 -05: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
yxxhero 904f303a34
optimize OCI chart version check (#1052)
* optimize OCI chart version check

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

* fix tests

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

---------

Signed-off-by: yxxhero <aiopsclub@163.com>
2023-10-07 02:16:41 -05:00
yxxhero 212c39cb53
feat: skip deps when installed is false (#1054)
Signed-off-by: yxxhero <aiopsclub@163.com>
2023-10-07 02:16:05 -05:00
yxxhero 06dfc16dc0
feat: bump helm to 3.13.0 (#1044)
Signed-off-by: yxxhero <aiopsclub@163.com>
2023-09-29 17:13:22 -05:00
Yuuki Takahashi 430a825b12
Add diffArgs to helmDefaults (#1019)
* Add diffArgs to helmDefaults

Signed-off-by: Yuuki Takahashi <20282867+yktakaha4@users.noreply.github.com>
2023-09-13 21:23:41 -05:00
Zoltán Reegn 4fb150238b
Fix symlink behaviour (#1020)
* Fix symlink behaviour

Make sure to evaluate symlinks when the path is not absolute and not
local. Otherwise just fall back to regular absolute paths.

Signed-off-by: Zoltán Reegn <zoltan.reegn@gmail.com>
2023-09-13 08:14:50 -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 803ff8d0ab
feat keyring supportting (#984)
* feat keyring supportting

Signed-off-by: yxxhero <aiopsclub@163.com>
2023-08-22 21:00:45 -05:00
yxxhero 85e037a946
bump helm to v3.12.3 (#971)
Signed-off-by: yxxhero <aiopsclub@163.com>
2023-08-12 11:04:08 +08:00
Jan-Otto Kröpke 9bc7bfc500
Implement --diff-args (#959)
Signed-off-by: Jan-Otto Kröpke <mail@jkroepke.de>
2023-08-09 19:47:15 +08:00
WrenIX ab50997798
chore: join with space (#963)
Signed-off-by: WrenIX <dev.github@wrenix.eu>
2023-08-08 13:25:54 +08: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
yxxhero cfa89d4040
feat: add insecure support for oci repo (#921)
* feat: add insecure support for oci repo

Signed-off-by: yxxhero <aiopsclub@163.com>
2023-07-24 09:09:10 +08:00
yxxhero 67ab08ab5e
fix: oci pull directory conflict when download twice (#914)
* fix: oci pull directory conflict when download twice

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

* add test cases
2023-07-23 21:10:03 +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 a3c1e32676
bump helm to v3.12.2 (#933)
Signed-off-by: yxxhero <aiopsclub@163.com>
2023-07-16 17:22:18 +08:00
Jan-Otto Kröpke d1c260af5f
feat: Allow to skip diff output on release base (#906)
* feat: Allow to skip diff output on release base

Signed-off-by: Jan-Otto Kröpke <mail@jkroepke.de>

* fix tests

Signed-off-by: Jan-Otto Kröpke <joe@cloudeteer.de>

* feat: Allow to skip diff output on release base

Signed-off-by: Jan-Otto Kröpke <mail@jkroepke.de>

* fix tests

Signed-off-by: Jan-Otto Kröpke <joe@cloudeteer.de>

* s/skipDiffOutput/suppressDiff

Signed-off-by: Jan-Otto Kröpke <joe@cloudeteer.de>

* s/skipDiffOutput/suppressDiff

Signed-off-by: Jan-Otto Kröpke <joe@cloudeteer.de>

* fix tests

Signed-off-by: Jan-Otto Kröpke <mail@jkroepke.de>

---------

Signed-off-by: Jan-Otto Kröpke <mail@jkroepke.de>
Signed-off-by: Jan-Otto Kröpke <joe@cloudeteer.de>
2023-07-02 07:50:59 +08:00
yxxhero b51842bb61
feat: add --insecure-skip-tls-verify support for helmfile template (#916) 2023-06-30 20:23:43 +08:00
xiaomudk 3384a40fd9
fix set-file cannot find the file on windows (#908) 2023-06-27 04:56:09 +08:00
yxxhero c55fa0f765
Replace interface{} by any (#901)
Signed-off-by: yxxhero <aiopsclub@163.com>
2023-06-16 10:49:05 +09: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 afcc9e4b80
fix: chartifyOpts ignore release set values (#896)
* fix: chartifyOpts ignore release set values

Signed-off-by: yxxhero <aiopsclub@163.com>
2023-06-13 23:28:27 +08:00
yxxhero df01973824
cleanup: remove panic in testutil (#890)
* cleanup: remove panic in testutil

Signed-off-by: yxxhero <aiopsclub@163.com>
2023-06-13 13:44:32 +08:00
yxxhero 2f0bc4b2e4
add unittest for storage (#894)
Signed-off-by: yxxhero <aiopsclub@163.com>
2023-06-13 13:20:40 +09:00
Yusuke Kuoka 1f1c817e86
Stop failing on single helmfile part missing specified env (#885)
* Stop failing on single helmfile part missing specified env

Ref https://github.com/helmfile/helmfile/issues/807

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

* Enhance RequireLog test helper to support updating snapshot

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

---------

Signed-off-by: Yusuke Kuoka <ykuoka@gmail.com>
2023-06-10 18:49:51 +08:00
Jan-Otto Kröpke f7b9de6ac1
Feat: add --strip-args-values-on-exit-error (#887)
* Add --strip-args-values-on-exit-error

Signed-off-by: Jan-Otto Kröpke <mail@jkroepke.de>
2023-06-07 14:39:38 +08:00
yxxhero 1843cc447e
Add insecure skip tls verify support (#882)
* feat: add insecure-skip-tls-verify support

Signed-off-by: yxxhero <aiopsclub@163.com>
2023-06-04 16:34:24 +08:00
yxxhero ae77967bf2
cleanup: remove tls configures about helm v2 (#880) 2023-06-03 22:02:46 +08:00
yxxhero 12a984d70f
feat: set RepositorySpec.PassCredentials var type to bool (#878)
* feat: set RepositorySpec.PassCredentials var type to bool

Signed-off-by: yxxhero <aiopsclub@163.com>
2023-06-01 13:41:45 +08:00
yxxhero e8f9bbbf9d
feat: update repo Spec var type skipTLSVerify to bool (#877)
* feat: update repo Spec var type skipTLSVerify to bool

Signed-off-by: yxxhero <aiopsclub@163.com>
2023-06-01 12:05:53 +08:00
Dejan Benedik 47328f31aa
fix: more stringent condition checking (#869)
The code requires `foo.enabled` condition pattern but didn't check the
latter part.

Signed-off-by: Dejan Benedik <dejan.benedik@3fs.si>
2023-05-25 16:05:14 +08:00
xiaomudk c498af3f52
Fix set flag are ignored when used in conjunction with jsonPatches (#867)
* Fix set flag are ignored when used in conjunction with jsonPatches

Signed-off-by: xiaomudk <xiaomudk@gmail.com>
2023-05-24 07:29:19 +08:00
SeWieland 8b3ad5b793
feat: make environment context available (#832)
* feat: make environment context available

This feature adds the "{{.Environment.KubeContext}}" variable.

Discussion #829

Signed-off-by: sewieland <sebastian.wieland@iav.de>

* chore: fix tests which compare logging outputs

This commit adds an addtional space wherever needed to the expected log outputs due to the added "KubeContext" in the environment struct.

Discussion #829

Signed-off-by: Sebastian Wieland <wieland.s@mailbox.org>

* docs: added documentation for `Environment.KubeContext`

Discussion #829

Signed-off-by: Sebastian Wieland <wieland.s@mailbox.org>

* test: make sure the `Environment.KubeContext` is mapped out correctly

Discussion #829

Signed-off-by: Sebastian Wieland <wieland.s@mailbox.org>

---------

Signed-off-by: sewieland <sebastian.wieland@iav.de>
Signed-off-by: Sebastian Wieland <wieland.s@mailbox.org>
Co-authored-by: sewieland <sebastian.wieland@iav.de>
2023-05-22 13:43:46 +09:00
yxxhero 3bbd816247
fix extra args missing in helmfile apply subcommand (#858)
Signed-off-by: yxxhero <aiopsclub@163.com>
2023-05-18 12:34:18 +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 54ed6bf0d5
bump helm to v3.12.0 (#855)
Signed-off-by: yxxhero <aiopsclub@163.com>
2023-05-11 10:35:17 +08:00
yxxhero 643f888703
fix: loadBases overrodeEnv issue (#838) 2023-05-08 05:24:32 +08:00
William Lahti b6dd7122f9
feat: add --skip-trailing-cr to helmfile diff (#625) 2023-05-08 05:23:59 +08: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
Vincent Stchu 3d0f0afe3a
Feat: support helm flag --enable-dns (#830)
* Support helm flag --enable-dns

Signed-off-by: vincent_stchu <24803055+vincentstchu@users.noreply.github.com>
2023-04-27 16:27:09 +08:00
Soh Takada a8a0a33c33
Add kube version flag (#804)
* add --kube-version flag into template cmd

Signed-off-by: FeLvi-zzz <34182539+FeLvi-zzz@users.noreply.github.com>

* add test

Signed-off-by: FeLvi-zzz <34182539+FeLvi-zzz@users.noreply.github.com>

* modify flag description

Signed-off-by: FeLvi-zzz <34182539+FeLvi-zzz@users.noreply.github.com>

* use switch

Signed-off-by: FeLvi-zzz <34182539+FeLvi-zzz@users.noreply.github.com>

* add comment

Signed-off-by: FeLvi-zzz <34182539+FeLvi-zzz@users.noreply.github.com>

---------

Signed-off-by: FeLvi-zzz <34182539+FeLvi-zzz@users.noreply.github.com>
2023-04-16 07:05:23 +08:00
AlexAxenti 0012e7e5a1
feat: add duration to affected releases on sync (#773)
* feat: add duration to affected releases on sync

Signed-off-by: Alexandru Axenti <alex.axenti@gmail.com>
2023-04-15 08:09:47 +08:00
yxxhero 7c72e2ba3e
fix: ValuesTemplate quote issue (#787)
* fix: ValuesTemplate quote issue

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

* optimize goccy yaml options

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

* add more options

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>
2023-04-14 13:03:26 +09:00
yxxhero 219602ebc7
bump helm to v3.11.3 (#802)
* bump helm to v3.11.3

Signed-off-by: yxxhero <aiopsclub@163.com>
2023-04-13 10:34:58 +08:00
Hans Song 1d0ba72b47
feat: add/expose cli flags (#771)
* feat: add/expose cli flags

Signed-off-by: Hans Song <hans.m.song@gmail.com>

* fix tests

Signed-off-by: Hans Song <hans.m.song@gmail.com>

* remove skipdeps from subcommand options

Signed-off-by: Hans Song <hans.m.song@gmail.com>

* remove skip-deps from subcommand flags

Signed-off-by: Hans Song <hans.m.song@gmail.com>

* remove SkipDeps from subcommand implementations

Signed-off-by: Hans Song <hans.m.song@gmail.com>

* update doco with new flags

Signed-off-by: Hans Song <hans.m.song@gmail.com>

---------

Signed-off-by: Hans Song <hans.m.song@gmail.com>
2023-04-02 14:53:52 +08:00
Quan TRAN 5650661a88
remove unnecessary remote.Locate() (#565)
* remove unnecessary Locate

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

* add remote test

Signed-off-by: Quan TRAN <itscaro@users.noreply.github.com>

---------

Signed-off-by: Quan TRAN <account@itscaro.me>
Signed-off-by: Quan TRAN <itscaro@users.noreply.github.com>
Co-authored-by: yxxhero <11087727+yxxhero@users.noreply.github.com>
2023-03-29 21:27:12 +08:00
yxxhero 5e8a502b41
feat: use new helm version parse function (#760)
* feat: use new helm version parse function

Signed-off-by: yxxhero <aiopsclub@163.com>
2023-03-23 08:46:11 +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 a817997ed8
bump mergo to 0.3.14 (#751)
bump merge to 0.3.14

Signed-off-by: yxxhero <aiopsclub@163.com>
2023-03-17 18:37:15 +08:00
yxxhero 063ba86447
fix concurrency issue (#742)
Signed-off-by: yxxhero <aiopsclub@163.com>
2023-03-15 15:42:16 +08:00
yxxhero 2d9f83c1de
clean: optimize postrenderer code (#738) 2023-03-14 06:18:20 +08:00
yxxhero 5cdec2dd51
clean: helm v2 logic code (#736)
Signed-off-by: yxxhero <aiopsclub@163.com>
2023-03-12 00:28:39 +08:00
yxxhero 400488d3ae
bump helm to 3.11.2 (#733)
Signed-off-by: yxxhero <aiopsclub@163.com>
2023-03-09 09:00:48 +08:00
yxxhero c21958557c
fix: improve set and values flags help message (#724)
Signed-off-by: yxxhero <aiopsclub@163.com>
2023-03-07 09:21:13 +09: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
yxxhero 522392c08c
fix get template func (#721) 2023-03-03 06:37:22 +08:00
Mitsuo Heijo dfe835a9c4
Use Masterminds/semver/v3 instead of hashicorp/go-version (#712)
Signed-off-by: Mitsuo Heijo <mitsuo.heijo@gmail.com>
2023-02-22 09:43:13 +08:00
yxxhero d0ef31e10b
optimize logger code (#706)
Signed-off-by: yxxhero <aiopsclub@163.com>
2023-02-19 23:20:47 +08:00
yxxhero f629ee1ae6
bump vals to v0.22.0 (#703)
Signed-off-by: yxxhero <aiopsclub@163.com>
2023-02-17 14:09:49 +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 37c213210e
bump helm to 3.11.1 (#695) 2023-02-12 20:15:57 +08:00
yxxhero 65eca3337e
fix panic issue (#690) 2023-02-10 07:32:08 +08:00
Yusuke Kuoka 8f2d97a1b3
Relax the forbid-env-with-releases policy for plain helmfile.yaml on v1 (#684) 2023-02-09 07:02:50 +08:00
Yusuke Kuoka 8c130a4fa7
fix: Make the forbid-env-with-releases policy strict on v1 (#683)
Currently, both v0 and v1 warns any usage of environments with releases within the same helmfile part.

It should rather be an error for v1, as proposed in https://github.com/helmfile/helmfile/blob/main/docs/proposals/towards-1.0.md#forbid-the-use-of-environments-and-releases-within-a-single-helmfileyaml-part.

Follow-up for #592

Signed-off-by: Yusuke Kuoka <ykuoka@gmail.com>
2023-02-08 09:09:12 +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
Yusuke Kuoka 59f32512fd
Use goccy/go-yaml fork to not break dynamic values on helmfile v1 (#675)
* Use goccy/go-yaml fork to not break dynamic values on helmfile v1

I forked goccy/go-yaml to https://github.com/helmfile/go-yaml and added a commit 259d2ed450 to let it produce YAML data compatible with other legacy YAML parsers that do not support YAML 1.2.

Ref https://github.com/helmfile/helmfile/discussions/656

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

* Add test for goccy/go-yaml fork behavior

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

---------

Signed-off-by: Yusuke Kuoka <ykuoka@gmail.com>
2023-02-06 11:39:27 +08:00
yxxhero abbdb6950b
feat: add gotmpl file ext when using helmfile.d feature (#649)
Closes #654

Signed-off-by: yxxhero <aiopsclub@163.com>
Co-authored-by: Yusuke Kuoka <ykuoka@gmail.com>
2023-01-25 08:34:39 +09:00
yxxhero 8bea5aee3e
use latest helm previous minor version for helmfile init (#652)
Signed-off-by: yxxhero <aiopsclub@163.com>

Signed-off-by: yxxhero <aiopsclub@163.com>
2023-01-24 13:44:52 +08:00
Yusuke Kuoka bc6317122b
Disable double-rendering in V1 (#647)
* Disable double-rendering in V1

We are going to force users to separate environments and releases sections in every helmfile.yaml in the [Helmfile V1](https://github.com/helmfile/helmfile/blob/main/docs/proposals/towards-1.0.md). The goal of separation was to make the helmfile.yaml rendering result not dependent on the double-rendering and therefore the feature should be safe to be turned off in V1.

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

* Fix helmfile template rendering error log for v1

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

* Add test for helmfile template debug log differences between v0 and v1 modes

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

* Fix helmfile template render debug log to not mention "first-pass" in v1 mode

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

Signed-off-by: Yusuke Kuoka <ykuoka@gmail.com>
2023-01-24 12:38:11 +08:00
Yusuke Kuoka 652b609b35
Do not load the legacy default charts.yaml in v1 (#651) 2023-01-24 07:01:31 +08:00
Yusuke Kuoka ec60ac815b
feat: Add missingFileHandlerConfig.ignoreMissingGitBranch (#645) 2023-01-23 17:27:00 +08:00
Yusuke Kuoka 543629f335
Remove unused go-getter driver funcs (#643)
The go-getter driver (named `Remote`) is used to implement remote values. I found some unused functions in its implementation. This commit removes those unused functions so that it becomes more maintainable.

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

Signed-off-by: Yusuke Kuoka <ykuoka@gmail.com>
2023-01-22 16:06:43 +08:00
yxxhero cff674b7e9
bump helm to v3.11.0 (#639)
* fix conflicts

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

* fix checksum

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

Signed-off-by: yxxhero <aiopsclub@163.com>
2023-01-21 11:56:03 +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
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
koralsky fc634c9ee3
feat: Reset values flag (#602)
Ref https://github.com/helmfile/helmfile/discussions/593

* implemented --reset-values flag overriding .helmDefaults.reuseValues=true
* tests for --reset-values flag
* fixed pkg/app tests
* added tests for both reset & reuse flags given
* added appendValuesControlMode method for --reuse/reset-values flag processing
* updated code comments & docs

Signed-off-by: Karol Ossowski <k@koralsky.pl>
2023-01-17 09:34:37 +09: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
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
yxxhero 8d96bbb0e4
feat: mark deprecated args and cmd for v1 (#628)
* feat: mark deprecated args and cmd for v1

Signed-off-by: yxxhero <aiopsclub@163.com>
2023-01-14 23:43:05 +08:00
yxxhero db5c2a52d6
Enhance tpl func test (#619)
enfore tpl func test

Signed-off-by: yxxhero <aiopsclub@163.com>
2023-01-07 11:04:52 +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
Yusuke Kuoka 6b19577987
Fix cryptic message on values template render error (#607)
Previously a values template rendering failure resulted in a cryptic error message like:

```
	g release templates in "input.yaml": failed executing templates in release "input.yaml"."foo1": failed executing template expressions in release "foo1".values[0] = "[98 97 115 101 76 97 98 101 108 58 32 34 123 123 32 103 101 116 32 46 82 101 108 101 97 115 101 46 76 97 98 101 108 115 32 92 34 98 97 115 101 92 34 32 92 34 78 79 84 95 73 78 72 69 82 73 84 69 68 92 34 32 125 125 34 10]": template: stringTemplate:1: unexpected "\\" in operand
```

The issue was that the values template at the value position of the YAML dict was printed as a formatted byte array. We now print it as a standard string so that it is easily readable.

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

Signed-off-by: Yusuke Kuoka <ykuoka@gmail.com>
2022-12-27 12:54:18 +08: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
Yusuke Kuoka 7860bddedc
Re: Strict helmfile.yaml file ext when rendered as template (#599)
This is a successor to #440 rebuilt on top of #594 so that we can merge this while we are still at Hemlfile v0.x without worrying any backward-incompatibility. Much appreciation to @yxxhero for the original work!

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

Signed-off-by: Yusuke Kuoka <ykuoka@gmail.com>
2022-12-23 08:28:49 +08:00
Yusuke Kuoka 8144638bab
feat: Helmfile V1 mode (#594)
* feat: Helmfile V1 mode

We add a new "V1 mode" to Helmfile so that you can seemlessly upgrade Helmfile from the current v0.x to the upcoming v1.0.

The idea is that we build both v0 and v1 binaries from the same tagged commit within the main branch, with different defaults for the "V1 mode"- the V1 mode is disabled by default for v0.x binaries, while it is enabled by default for v1.x binaries.

The V1 mode can be overrode at runtime via envvar. That is, even after upgrading the binary to v1, you will not see any backward-incompatible changes while you explicitly set an envvar, `HELMFILE_V1MODE=true`, at runtime.

Signed-off-by: Yusuke Kuoka <ykuoka@gmail.com>
Signed-off-by: yxxhero <aiopsclub@163.com>
2022-12-22 20:30:44 +09:00
yxxhero d8d0bf830a
Add helmfile state validate policy (#592) 2022-12-21 10:49:31 +08:00
yxxhero 8ce539f4de
use yaml v3 UnmarshalYAML (#587)
Signed-off-by: yxxhero <aiopsclub@163.com>

Signed-off-by: yxxhero <aiopsclub@163.com>
2022-12-19 06:40:07 +09:00
yxxhero 36c91c5427
optimize lint logic (#586)
Signed-off-by: yxxhero <aiopsclub@163.com>
2022-12-18 08:39:45 +08:00
yxxhero 7410316cf9
update postrenderer docs (#580)
Signed-off-by: yxxhero <aiopsclub@163.com>

Signed-off-by: yxxhero <aiopsclub@163.com>
2022-12-15 11:50:18 +08:00
yxxhero 17b03c22ec
bump helm to v3.10.3 (#579)
Signed-off-by: yxxhero <aiopsclub@163.com>

Signed-off-by: yxxhero <aiopsclub@163.com>
2022-12-15 09:00:22 +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
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 d0915641ca Fix TestGenerateID
Signed-off-by: yxxhero <aiopsclub@163.com>
2022-12-13 13:12:07 +08:00
Yusuke Kuoka c2e7804479 Add --post-render support also for diff
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
guofutan 0a953731b0 fix(#507): support assign --post-renderer within helmfile flags and helmdefault or release config
1. only implement post-renderer flags this patch
2. As mumoshu advise, add helmfile flags `--post-render` and add the
   postRenderer  config in helmDefaults and release. the priority is
   helmfile flags > release > helmDefaults.
3. fix the test case in state_test.go and some other tests.

Signed-off-by: guofutan <guofutan@tencent.com>
Signed-off-by: yxxhero <aiopsclub@163.com>
2022-12-13 13:12:07 +08:00
guofutan 1f0f7ec8d6 fix(#510): fea add postRenderer and postRendererArgs config in helmDefault of helmfile.yaml
Signed-off-by: guofutan <guofutan@tencent.com>
Signed-off-by: yxxhero <aiopsclub@163.com>
2022-12-13 13:12:07 +08:00
guofutan 4cc07daced fix(#510): fix golangci-lint run error,add the unit test, add the compatibility when there is blank in the args values.
Signed-off-by: guofutan <guofutan@tencent.com>
Signed-off-by: yxxhero <aiopsclub@163.com>
2022-12-13 13:12:07 +08:00
guofutan 7be64f29cf fea(#507): support assign `--post-renderer` and `--post-renderer-args` within args in helmDefaults when use helm v3
Signed-off-by: guofutan <guofutan@tencent.com>
Signed-off-by: yxxhero <aiopsclub@163.com>
2022-12-13 13:12:07 +08:00
xiaomudk 94381c1e17
Fix preapply hooks are not called on no diff when run apply subcommand (#522)
* Fix presync hooks are not called on no diff when run apply subcommand

Signed-off-by: xiaomudk <xiaomudk@gmail.com>

* Update docs/index.md

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

Signed-off-by: xiaomudk <xiaomudk@gmail.com>
Co-authored-by: Yusuke Kuoka <ykuoka@gmail.com>
2022-12-10 12:07:26 +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
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
yxxhero 85f577e551
Merge pull request #533 from xiaomudk/patch-9
Fix getArray function copy error
2022-11-22 07:15:48 +08:00
xiaomudk a05ccab6c3 Fix getArray function copy error
Signed-off-by: xiaomudk <xiaomudk@gmail.com>
2022-11-21 23:30:13 +08:00
koralsky 1ba83ae722
declare "reuse values" control mode in helmDefaults (#527)
* support for helmDefaults.reuseValues

Signed-off-by: Karol Ossowski <k@koralsky.pl>
2022-11-20 08:47:48 +08:00
Yusuke Kuoka 8d2aec249d Use the new log capturing helper in all tests
Signed-off-by: Yusuke Kuoka <ykuoka@gmail.com>
2022-11-13 08:53:53 +00:00
Yusuke Kuoka 6b69b31754 Use log capturing helper in TestApply_hooks
Along with the addition of the new arg to the helper for log level customization.

Signed-off-by: Yusuke Kuoka <ykuoka@gmail.com>
2022-11-13 08:20:13 +00: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
Yusuke Kuoka 844f6e9583 Introduce a new test helper for easier log snapshot testing
Use the new runWithLogCapture helper instead of the long boilerplate to capture the log for snapshot testing.

Signed-off-by: Yusuke Kuoka <ykuoka@gmail.com>
2022-11-13 03:24:24 +00: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 2324188695 bump: helm to 3.10.2
Signed-off-by: yxxhero <aiopsclub@163.com>
2022-11-11 13:54:35 +08:00
Helge Eichelberg 8f59a1c18a
Add --output-dir-template flag to the fetch command (#456)
* Add --output-dir-template flag to the fetch command

Signed-off-by: elchenberg <elchenberg@users.noreply.github.com>
2022-11-05 18:55:02 +08:00
yxxhero bc3528ae09 fix: args parse issue
Signed-off-by: yxxhero <aiopsclub@163.com>
2022-11-04 10:53:00 +09: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
Quan TRAN 2702161e74
add basepath along with filepath into yaml comment (#460)
* add basepath along with filepath into yaml comment

Signed-off-by: Quan TRAN <itscaro@users.noreply.github.com>
2022-10-25 17:44:28 +08:00
yxxhero f8a297bbac fix --debug flag
Signed-off-by: yxxhero <aiopsclub@163.com>
2022-10-25 08:24:23 +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
Indrek Juhkam a409b450cd
Add `--skip-refresh` flag to the build command (#444)
This improves the `helmfile sync` performance.

From the code: `BuildDeps` is used only by `runHelmDepBuilds`, which
only is used by `PrepareCharts` which is finally only used by
`withPreparedCharts`.

`withPreparedCharts` already does `SyncReposOnce` which means we do not
have to refresh the local repository cache on each chart build.

This is only supported in Helm v3.

This seems to be mostly affecting helmfiles which have a lot of releases
and those release charts use sub dependencies.

I saw significant performance improvements for a helmfile with 45
releases, 2 repositories, and most of the charts also had their own
dependencies. Results:

Before the patch:
* real  9m10.565s
* real  9m38.335s
* real  9m14.941s
* real  5m13.106s (with cache)

After the patch:
* real  6m51.965s
* real  6m36.605s
* real  6m31.685s
* real  3m0.271s (with cache)

These were tested with:
```
rm -rf ~/.cache/helmfile ~/.cache/helm ~/.config/helm/repositories.* && helmfile sync ...
```

The result with `(with cache)` was without deleting the caches first.

From these metrics it seems that the sync duration decreased 20-45%
depending on the run, release count, dependencies and if the cache was
used or not.

As far as I understand, this should be backward-compatible change.

Signed-off-by: Indrek Juhkam <indrek@urgas.eu>

Signed-off-by: Indrek Juhkam <indrek@urgas.eu>
2022-10-20 09:03:08 +09:00
yxxhero f2be4861d5
Merge pull request #441 from helmfile/move_upgrade_notice_env_into_envvar 2022-10-20 05:18:19 +08:00
yxxhero 420f5b2079
Merge pull request #451 from helmfile/445-01470-fails-to-execute-diff
fix helmfile diff error in window platform
2022-10-19 18:18:02 +08:00
yxxhero 94cc07cdf2
Merge pull request #446 from helmfile/fix_deps_args
fix: fix deps args
2022-10-19 18:15:43 +08:00
yxxhero 62cbeb661d fix helmfile diff error in window platform
Signed-off-by: yxxhero <aiopsclub@163.com>
2022-10-19 17:50:56 +08:00
yxxhero 61233badd5 fix: issue path in test on windows
Signed-off-by: yxxhero <aiopsclub@163.com>
2022-10-19 08:46:43 +08:00
yxxhero da2ce574b0 fix: fix deps args
Signed-off-by: yxxhero <aiopsclub@163.com>
2022-10-18 22:01:05 +08:00
yxxhero ed228c9c7e move HELMFILE_UPGRADE_NOTICE_DISABLED into envvar file
Signed-off-by: yxxhero <aiopsclub@163.com>
2022-10-15 14:22:51 +08:00
Rui Chen ffce09a35f
deps: update dockerfile dependencies (#421)
* deps: helm 3.10.0

Signed-off-by: Rui Chen <rui@chenrui.dev>
2022-10-12 20:41:26 +08:00
Yusuke Kuoka b7da0965f1 fixup! Address a lint error
Signed-off-by: Yusuke Kuoka <ykuoka@gmail.com>
2022-10-11 08:20:51 +08:00
Yusuke Kuoka ef115ba653 Address a lint error
Signed-off-by: Yusuke Kuoka <ykuoka@gmail.com>
2022-10-11 08:20:51 +08:00
Yusuke Kuoka 85bfe64b90 fixup! fixup! fixup! fixup! fixup! fixup! fixup! fixup! fixup! Fix preapply hook behavior
Signed-off-by: Yusuke Kuoka <ykuoka@gmail.com>
2022-10-11 08:20:51 +08:00
Yusuke Kuoka caee32f7be fixup! fixup! fixup! fixup! fixup! fixup! fixup! fixup! Fix preapply hook behavior
Signed-off-by: Yusuke Kuoka <ykuoka@gmail.com>
2022-10-11 08:20:51 +08:00
Yusuke Kuoka a2d5d82cb6 fixup! fixup! fixup! fixup! fixup! fixup! fixup! Fix preapply hook behavior
Signed-off-by: Yusuke Kuoka <ykuoka@gmail.com>
2022-10-11 08:20:51 +08:00
Yusuke Kuoka 3e2285ea72 fixup! fixup! fixup! fixup! fixup! fixup! Fix preapply hook behavior
Signed-off-by: Yusuke Kuoka <ykuoka@gmail.com>
2022-10-11 08:20:51 +08:00
Yusuke Kuoka f7f858cc52 fixup! fixup! fixup! fixup! fixup! Fix preapply hook behavior
Signed-off-by: Yusuke Kuoka <ykuoka@gmail.com>
2022-10-11 08:20:51 +08:00
Yusuke Kuoka 95065f8d28 fixup! fixup! fixup! fixup! Fix preapply hook behavior
Signed-off-by: Yusuke Kuoka <ykuoka@gmail.com>
2022-10-11 08:20:51 +08:00
Yusuke Kuoka 2ff0969e3b fixup! fixup! fixup! Fix preapply hook behavior
Signed-off-by: Yusuke Kuoka <ykuoka@gmail.com>
2022-10-11 08:20:51 +08:00
Yusuke Kuoka 3a5d9efb20 fixup! fixup! Fix preapply hook behavior
Signed-off-by: Yusuke Kuoka <ykuoka@gmail.com>
2022-10-11 08:20:51 +08:00
Yusuke Kuoka 111a248523 fixup! Fix preapply hook behavior
Signed-off-by: Yusuke Kuoka <ykuoka@gmail.com>
2022-10-11 08:20:51 +08:00
Yusuke Kuoka c2ea0f0355 Fix preapply hook behavior
Fixes #399

Signed-off-by: Yusuke Kuoka <ykuoka@gmail.com>
2022-10-11 08:20:51 +08:00
Yusuke Kuoka e001f6f05d Address golangci-lint finding
Signed-off-by: Yusuke Kuoka <ykuoka@gmail.com>
2022-10-11 06:19:32 +09:00
Yusuke Kuoka c762310a5f fixup! Prevent excessive log in tests
Signed-off-by: Yusuke Kuoka <ykuoka@gmail.com>
2022-10-11 06:19:32 +09:00
Yusuke Kuoka 31cd729fd4 Prevent excessive log in tests
I had been unhappy with the fact that our go-test output had a lot of debug log messages which obfuscated test results.

I'm finally removeing all those by directing the test log output to io.Discard.

Signed-off-by: Yusuke Kuoka <ykuoka@gmail.com>
2022-10-11 06:19:32 +09:00
yxxhero 6a36f34c7d
fix: child process not exit when recive term signal (#418)
* fix: child process not exit when recive term signal

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

* fix: wait for clean done

Signed-off-by: Yusuke Kuoka <ykuoka@gmail.com>
Signed-off-by: yxxhero <aiopsclub@163.com>
Co-authored-by: Yusuke Kuoka <ykuoka@gmail.com>
2022-10-09 17:51:52 +09:00
yxxhero ad257554c9
Merge pull request #419 from helmfile/405-helmfile-deps-cannot-create-a-lock-file-for-an-oci-repo
fix: helmfile deps issue with oci repo
2022-10-09 09:13:46 +08:00
yxxhero d1c31e8c17 fix: helmfile deps issue with oci repo
Signed-off-by: yxxhero <aiopsclub@163.com>
2022-10-09 08:56:52 +08:00
yxxhero 21c28ca6d0
feat: add reuse-values args for diff apply and sync (#411)
Signed-off-by: yxxhero <aiopsclub@163.com>

Signed-off-by: yxxhero <aiopsclub@163.com>
2022-10-08 14:27:39 +09:00
yxxhero 8f7796b260
feat: optimize version output (#412)
* feat: optimize version output

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

* Update docs/index.md

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

Signed-off-by: yxxhero <aiopsclub@163.com>
Co-authored-by: Yusuke Kuoka <ykuoka@gmail.com>
2022-10-08 14:26:15 +09:00
yxxhero e06abe4620
feat: add more clear error message and Environment info for template (#413)
* feat: add more clear error message and Environment info for template

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

* Update pkg/state/state.go

Co-authored-by: Yusuke Kuoka <ykuoka@gmail.com>
Signed-off-by: yxxhero <aiopsclub@163.com>

Signed-off-by: yxxhero <aiopsclub@163.com>
Co-authored-by: Yusuke Kuoka <ykuoka@gmail.com>
2022-10-07 10:56:32 +09:00
Kevin Leturc 422852dd9a feat: retrieve repository's username/password from environment
Signed-off-by: Kevin Leturc <kevinleturc@users.noreply.github.com>
2022-10-06 16:48:44 +02: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 e6b263340d
Merge pull request #388 from helmfile/fix_retain_values_issue
fix SetRetainValuesFiles issue
2022-10-05 10:10:34 +08:00
Felipe Santos f15bdbbb0c Use helm show chart to identify chart version
Signed-off-by: Felipe Santos <felipecassiors@gmail.com>
2022-10-03 22:04:08 -03:00
mugioka 68728ef352 chore: add test for gatherOCIUsernamePassword.
Signed-off-by: mugioka <okamugi0722@gmail.com>
2022-10-03 15:45:40 +09:00
mugioka a42c14e640 imprv: convert hyphen included in repo name to underbar with gatherOCIUsernamePassword.
Most shells do not support hyphens in environment variables.

However, there are cases where you may want to include hyphens in the repository name.

Therefore, I have included a process in `gatherOCIUsernamePassword` to replace hyphens with underbar.

Signed-off-by: mugioka <okamugi0722@gmail.com>
2022-10-03 14:49:03 +09: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
yxxhero 06cfdfc891 fix SetRetainValuesFiles issue
Signed-off-by: yxxhero <aiopsclub@163.com>
2022-09-24 12:10:42 +08:00
yxxhero a36f07cda3 fix path issue in windows
Signed-off-by: yxxhero <aiopsclub@163.com>
2022-09-23 09:10:36 +08:00
Yusuke Kuoka c90cace43b fixup! Fix not to ignore diff selector when it matched nothing
Signed-off-by: Yusuke Kuoka <ykuoka@gmail.com>
2022-09-19 04:46:52 +00:00
Yusuke Kuoka 6aeb6b38ba Fix not to ignore diff selector when it matched nothing
Fixes #327

Signed-off-by: Yusuke Kuoka <ykuoka@gmail.com>
2022-09-19 04:46:52 +00:00
Yusuke Kuoka bb13ef68d7 fixup! Add more testcases for hooks
Signed-off-by: Yusuke Kuoka <ykuoka@gmail.com>
2022-09-19 02:31:07 +00:00
Yusuke Kuoka dc40ccde2e Add more testcases for hooks
Signed-off-by: Yusuke Kuoka <ykuoka@gmail.com>
2022-09-19 02:19:42 +00:00
Yusuke Kuoka 793050cc18 Defer implementing preapply hook start logs to another commit/pr
Signed-off-by: Yusuke Kuoka <ykuoka@gmail.com>
2022-09-19 00:44:31 +00:00