Commit Graph

9 Commits

Author SHA1 Message Date
Nemanja Zeljkovic 56c01ee510 Add support for key+ syntax
Signed-off-by: Nemanja Zeljkovic <nocturo@gmail.com>
2025-07-30 15:29:21 +02: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 867bef0f03
feat(yaml): add JSON style encoding option to NewEncoder (#2038) 2025-05-13 18:45:22 +08:00
yxxhero 844726b09b
feat(tmpl): enhance ToYaml test with multiple scenarios (#2031)
* feat(tmpl): enhance ToYaml test with multiple scenarios

Signed-off-by: yxxhero <aiopsclub@163.com>
2025-05-09 11:56:54 +08:00
dependabot[bot] f0965d6d03
build(deps): bump github.com/goccy/go-yaml from 1.13.9 to 1.14.0 (#1782)
* build(deps): bump github.com/goccy/go-yaml from 1.13.9 to 1.14.0

Bumps [github.com/goccy/go-yaml](https://github.com/goccy/go-yaml) from 1.13.9 to 1.14.0.
- [Release notes](https://github.com/goccy/go-yaml/releases)
- [Changelog](https://github.com/goccy/go-yaml/blob/master/CHANGELOG.md)
- [Commits](https://github.com/goccy/go-yaml/compare/v1.13.9...v1.14.0)

---
updated-dependencies:
- dependency-name: github.com/goccy/go-yaml
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>

* feat(yaml): allow duplicate keys in strict mode

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

---------

Signed-off-by: dependabot[bot] <support@github.com>
Signed-off-by: yxxhero <aiopsclub@163.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: yxxhero <aiopsclub@163.com>
2024-11-14 08:27:43 +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 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
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 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