helmfile/pkg/state
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
..
testdata Add regression tests for environment values merge (#1170) 2020-04-04 14:27:29 +09:00
chart_dependency.go Use goccy/go-yaml for v1 / Prep bringing back go-yaml v2 for v0.x (#604) 2022-12-27 10:14:35 +09:00
chart_dependency_test.go fix: helmfile deps issue with oci repo 2022-10-09 08:56:52 +08:00
create.go Use goccy/go-yaml for v1 / Prep bringing back go-yaml v2 for v0.x (#604) 2022-12-27 10:14:35 +09:00
create_test.go Add the ability to specify a lock file (#432) 2022-11-12 08:59:56 +09:00
environment.go Add support for kubeContext in environments (#1675) 2021-03-23 18:06:53 +09:00
envvals_loader.go Use goccy/go-yaml for v1 / Prep bringing back go-yaml v2 for v0.x (#604) 2022-12-27 10:14:35 +09:00
envvals_loader_test.go Prevent excessive log in tests 2022-10-11 06:19:32 +09:00
helmx.go optimize lint logic (#586) 2022-12-18 08:39:45 +08:00
release.go Use goccy/go-yaml for v1 / Prep bringing back go-yaml v2 for v0.x (#604) 2022-12-27 10:14:35 +09:00
release_error.go Fix misleading `helmfile diff` output (#1174) 2020-04-04 17:39:20 +09:00
release_filters.go Allow more characters in label selectors (#2064) 2022-03-09 20:38:29 +09:00
selector_test.go fix: helmfile template fails when selector matches a chart fetched with go-getter 2022-11-13 15:10:57 +08:00
state.go Use goccy/go-yaml for v1 / Prep bringing back go-yaml v2 for v0.x (#604) 2022-12-27 10:14:35 +09:00
state_exec_tmpl.go Use goccy/go-yaml for v1 / Prep bringing back go-yaml v2 for v0.x (#604) 2022-12-27 10:14:35 +09:00
state_exec_tmpl_test.go Use goccy/go-yaml for v1 / Prep bringing back go-yaml v2 for v0.x (#604) 2022-12-27 10:14:35 +09:00
state_gogetter_test.go Prevent excessive log in tests 2022-10-11 06:19:32 +09:00
state_run.go fix: helmfile template fails when selector matches a chart fetched with go-getter 2022-11-13 15:10:57 +08:00
state_test.go fix(#507): support assign --post-renderer within helmfile flags and helmdefault or release config 2022-12-13 13:12:07 +08:00
storage.go Introduce Helmfile's own filesystem abstraction to correctly unit test some components (#307) 2022-08-24 12:58:43 +09:00
storage_test.go Prevent excessive log in tests 2022-10-11 06:19:32 +09:00
temp.go fix lint error 2022-08-13 07:40:32 +08:00
temp_test.go Fix TestGenerateID 2022-12-13 13:12:07 +08:00
types.go Rename module to github.com/helmfile/helmfile 2022-05-18 10:05:07 -04:00
util.go Avoid --skip-refresh on local charts (#541) 2022-12-13 13:12:07 +08:00
util_test.go Add support for ChartCenter (#1492) 2020-09-21 15:31:24 +09:00