[EPIC] 迁移到未来可用的 YAML 库
作者: moio创建于 2026年7月21日更新于 2026年9月30日
标签Epic
The widely used gopkg.in/yaml.v3 YAML library for Go (https://GitHub.com/go-yaml/yaml) has been archived and is now unmaintained.
A new security-maintained fork by the YAML organization go.yaml.in/yaml/v3 (https://GitHub.com/yaml/go-yaml) now exists - this issue is to update our codebase to use it.
Guideline
- Focus on direct dependencies first. If it is possible to update indirect ones, that's also welcome, but not strictly required
- Focus on
mainfirst. If it is trivial to backport, that's also welcome, but not strictly required - Several maintained versions of the new library exist:
go.yaml.in/yaml/v2andv3(identical interfaces, security maintained) orgo.yaml.in/yaml/v4(with new features). Usev4for new code and transition to it where that brings advantages, otherwisev3 - If other dependencies indirectly require the old package, replacement is also a possibility
- Migrate away from the
GitHub.com/ghodss/yamllibrary, that wrapsv2and has not seen updates since 2017. Replace withsigs.k8s.io/yamlwhich is a maintained direct replacement and usesgo.yaml.in/yamlinternally
内容来源: rancher/rancher