#56157·rancher

[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 main first. 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/v2 and v3 (identical interfaces, security maintained) or go.yaml.in/yaml/v4 (with new features). Use v4 for new code and transition to it where that brings advantages, otherwise v3
  • If other dependencies indirectly require the old package, replacement is also a possibility
  • Migrate away from the GitHub.com/ghodss/yaml library, that wraps v2 and has not seen updates since 2017. Replace with sigs.k8s.io/yaml which is a maintained direct replacement and uses go.yaml.in/yaml internally

内容来源: rancher/rancher