From f77083b563dfdbb22a40930f3caf16a0c1ba82db Mon Sep 17 00:00:00 2001 From: Kevin McDermott Date: Tue, 28 Jul 2026 11:58:46 +0100 Subject: [PATCH] Switch out the Go YAML package (#1089) This replaces direct usage of "gopkg.in/yaml.v3" with "go.yaml.in/yaml/v4". The original package is now a dependency of the testify packages. --- go.mod | 4 +++- go.sum | 2 ++ pkg/controller/cluster/agent/ports.go | 2 +- pkg/controller/cluster/agent/shared.go | 2 +- pkg/controller/cluster/agent/shared_test.go | 2 +- pkg/controller/cluster/agent/virtual.go | 2 +- pkg/controller/cluster/agent/virtual_test.go | 2 +- pkg/controller/cluster/server/config.go | 2 +- 8 files changed, 11 insertions(+), 7 deletions(-) diff --git a/go.mod b/go.mod index 672948cb..fa9347e3 100644 --- a/go.mod +++ b/go.mod @@ -22,7 +22,7 @@ require ( go.etcd.io/etcd/api/v3 v3.7.0 go.etcd.io/etcd/client/v3 v3.7.0 go.uber.org/zap v1.28.0 - gopkg.in/yaml.v3 v3.0.1 + go.yaml.in/yaml/v4 v4.0.0-rc.6 k8s.io/api v0.36.2 k8s.io/apiextensions-apiserver v0.36.2 k8s.io/apimachinery v0.36.2 @@ -38,6 +38,8 @@ require ( sigs.k8s.io/controller-runtime v0.24.1 ) +require gopkg.in/yaml.v3 v3.0.1 // indirect + require ( cel.dev/expr v0.25.1 // indirect github.com/Azure/go-ansiterm v0.0.0-20250102033503-faa5f7b0171c // indirect diff --git a/go.sum b/go.sum index 232db61a..51327331 100644 --- a/go.sum +++ b/go.sum @@ -302,6 +302,8 @@ go.yaml.in/yaml/v2 v2.4.3 h1:6gvOSjQoTB3vt1l+CU+tSyi/HOjfOjRLJ4YwYZGwRO0= go.yaml.in/yaml/v2 v2.4.3/go.mod h1:zSxWcmIDjOzPXpjlTTbAsKokqkDNAVtZO0WOMiT90s8= go.yaml.in/yaml/v3 v3.0.4 h1:tfq32ie2Jv2UxXFdLJdh3jXuOzWiL1fo0bu/FbuKpbc= go.yaml.in/yaml/v3 v3.0.4/go.mod h1:DhzuOOF2ATzADvBadXxruRBLzYTpT36CKvDb3+aBEFg= +go.yaml.in/yaml/v4 v4.0.0-rc.6 h1:1h7H1ohdUh93/FyE4YaDa1Zh64K6VVbjF4K6WUxMtH4= +go.yaml.in/yaml/v4 v4.0.0-rc.6/go.mod h1:aZqd9kCMsGL7AuUv/m/PvWLdg5sjJsZ4oHDEnfPPfY0= golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= golang.org/x/crypto v0.53.0 h1:QZ4Muo8THX6CizN2vPPd5fBGHyogrdK9fG4wLPFUsto= diff --git a/pkg/controller/cluster/agent/ports.go b/pkg/controller/cluster/agent/ports.go index 0faf9131..bcb5328b 100644 --- a/pkg/controller/cluster/agent/ports.go +++ b/pkg/controller/cluster/agent/ports.go @@ -5,7 +5,7 @@ import ( "fmt" "os" - "gopkg.in/yaml.v3" + "go.yaml.in/yaml/v4" "k8s.io/apimachinery/pkg/types" "k8s.io/kubernetes/pkg/apis/core" "k8s.io/kubernetes/pkg/registry/core/service/portallocator" diff --git a/pkg/controller/cluster/agent/shared.go b/pkg/controller/cluster/agent/shared.go index 6f0e9f4a..d07a189c 100644 --- a/pkg/controller/cluster/agent/shared.go +++ b/pkg/controller/cluster/agent/shared.go @@ -5,7 +5,7 @@ import ( "errors" "fmt" - "gopkg.in/yaml.v3" + "go.yaml.in/yaml/v4" "k8s.io/apimachinery/pkg/util/intstr" appsv1 "k8s.io/api/apps/v1" diff --git a/pkg/controller/cluster/agent/shared_test.go b/pkg/controller/cluster/agent/shared_test.go index 73719705..59965e38 100644 --- a/pkg/controller/cluster/agent/shared_test.go +++ b/pkg/controller/cluster/agent/shared_test.go @@ -5,7 +5,7 @@ import ( "testing" "github.com/stretchr/testify/assert" - "gopkg.in/yaml.v3" + "go.yaml.in/yaml/v4" "k8s.io/apimachinery/pkg/api/resource" "k8s.io/utils/ptr" diff --git a/pkg/controller/cluster/agent/virtual.go b/pkg/controller/cluster/agent/virtual.go index 18c7d2d9..b05d5c12 100644 --- a/pkg/controller/cluster/agent/virtual.go +++ b/pkg/controller/cluster/agent/virtual.go @@ -6,7 +6,7 @@ import ( "fmt" "strings" - "gopkg.in/yaml.v3" + "go.yaml.in/yaml/v4" "k8s.io/utils/ptr" appsv1 "k8s.io/api/apps/v1" diff --git a/pkg/controller/cluster/agent/virtual_test.go b/pkg/controller/cluster/agent/virtual_test.go index 5ca32395..3303134c 100644 --- a/pkg/controller/cluster/agent/virtual_test.go +++ b/pkg/controller/cluster/agent/virtual_test.go @@ -5,7 +5,7 @@ import ( "testing" "github.com/stretchr/testify/assert" - "gopkg.in/yaml.v3" + "go.yaml.in/yaml/v4" "k8s.io/apimachinery/pkg/api/resource" "k8s.io/utils/ptr" diff --git a/pkg/controller/cluster/server/config.go b/pkg/controller/cluster/server/config.go index f4635003..2e041d0b 100644 --- a/pkg/controller/cluster/server/config.go +++ b/pkg/controller/cluster/server/config.go @@ -3,7 +3,7 @@ package server import ( "fmt" - "gopkg.in/yaml.v3" + "go.yaml.in/yaml/v4" "k8s.io/apimachinery/pkg/util/sets" corev1 "k8s.io/api/core/v1"