helmfile/pkg
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
..
app Use goccy/go-yaml for v1 / Prep bringing back go-yaml v2 for v0.x (#604) 2022-12-27 10:14:35 +09:00
argparser fix(#507): support assign --post-renderer within helmfile flags and helmdefault or release config 2022-12-13 13:12:07 +08:00
config update postrenderer docs (#580) 2022-12-15 11:50:18 +08:00
environment Use goccy/go-yaml for v1 / Prep bringing back go-yaml v2 for v0.x (#604) 2022-12-27 10:14:35 +09:00
envvar feat: Helmfile V1 mode (#594) 2022-12-22 20:30:44 +09:00
errors fix incorrent exit code 2022-09-13 08:23:55 +08:00
event feat: show live output from the Helm binary (#286) 2022-09-18 14:24:35 +09:00
exectest Avoid --skip-refresh on local charts (#541) 2022-12-13 13:12:07 +08:00
filesystem Allow helmfile statefile to passed by stdin (#520) 2022-11-22 11:34:05 +08:00
helmexec Use goccy/go-yaml for v1 / Prep bringing back go-yaml v2 for v0.x (#604) 2022-12-27 10:14:35 +09:00
maputil Use goccy/go-yaml for v1 / Prep bringing back go-yaml v2 for v0.x (#604) 2022-12-27 10:14:35 +09:00
plugins add Go lint 2022-07-16 20:21:11 +08:00
policy Add helmfile state validate policy (#592) 2022-12-21 10:49:31 +08:00
remote Use goccy/go-yaml for v1 / Prep bringing back go-yaml v2 for v0.x (#604) 2022-12-27 10:14:35 +09:00
runtime feat: Helmfile V1 mode (#594) 2022-12-22 20:30:44 +09:00
state Use goccy/go-yaml for v1 / Prep bringing back go-yaml v2 for v0.x (#604) 2022-12-27 10:14:35 +09:00
testhelper Prevent excessive log in tests 2022-10-11 06:19:32 +09:00
testutil add Go lint 2022-07-16 20:21:11 +08:00
tmpl Use goccy/go-yaml for v1 / Prep bringing back go-yaml v2 for v0.x (#604) 2022-12-27 10:14:35 +09:00
yaml Use goccy/go-yaml for v1 / Prep bringing back go-yaml v2 for v0.x (#604) 2022-12-27 10:14:35 +09:00