From 9b549fa1183b008d10f77cd7453c06a406832ada Mon Sep 17 00:00:00 2001 From: Ben Kochie Date: Thu, 22 Jan 2026 16:36:30 +0100 Subject: [PATCH] Update Go yaml v3 library (#17913) Replace archived `gopkg.in/yaml.v3` with supported `go.yaml.in/yaml/v3`. Fixes: https://github.com/prometheus/prometheus/issues/16415 Signed-off-by: SuperQ --- discovery/aws/aws_test.go | 2 +- go.mod | 4 ++-- model/rulefmt/rulefmt.go | 2 +- model/rulefmt/rulefmt_test.go | 2 +- 4 files changed, 5 insertions(+), 5 deletions(-) diff --git a/discovery/aws/aws_test.go b/discovery/aws/aws_test.go index 9d3728911b..dc1f2044ec 100644 --- a/discovery/aws/aws_test.go +++ b/discovery/aws/aws_test.go @@ -20,7 +20,7 @@ import ( "github.com/prometheus/common/model" "github.com/stretchr/testify/require" - "gopkg.in/yaml.v3" + "go.yaml.in/yaml/v3" ) func TestRoleUnmarshalYAML(t *testing.T) { diff --git a/go.mod b/go.mod index ab3464f72a..afc3f2740d 100644 --- a/go.mod +++ b/go.mod @@ -84,6 +84,7 @@ require ( go.uber.org/automaxprocs v1.6.0 go.uber.org/goleak v1.3.0 go.yaml.in/yaml/v2 v2.4.3 + go.yaml.in/yaml/v3 v3.0.4 golang.org/x/oauth2 v0.34.0 golang.org/x/sync v0.19.0 golang.org/x/sys v0.39.0 @@ -92,7 +93,6 @@ require ( google.golang.org/genproto/googleapis/api v0.0.0-20251222181119-0a764e51fe1b google.golang.org/grpc v1.78.0 google.golang.org/protobuf v1.36.11 - gopkg.in/yaml.v3 v3.0.1 k8s.io/api v0.34.3 k8s.io/apimachinery v0.34.3 k8s.io/client-go v0.34.3 @@ -114,7 +114,7 @@ require ( github.com/go-openapi/swag/typeutils v0.25.4 // indirect github.com/go-openapi/swag/yamlutils v0.25.4 // indirect go.uber.org/multierr v1.11.0 // indirect - go.yaml.in/yaml/v3 v3.0.4 // indirect + gopkg.in/yaml.v3 v3.0.1 // indirect sigs.k8s.io/structured-merge-diff/v6 v6.3.0 // indirect ) diff --git a/model/rulefmt/rulefmt.go b/model/rulefmt/rulefmt.go index 70541eb0d3..2cbfdf4cfc 100644 --- a/model/rulefmt/rulefmt.go +++ b/model/rulefmt/rulefmt.go @@ -24,7 +24,7 @@ import ( "time" "github.com/prometheus/common/model" - "gopkg.in/yaml.v3" + "go.yaml.in/yaml/v3" "github.com/prometheus/prometheus/model/timestamp" "github.com/prometheus/prometheus/promql" diff --git a/model/rulefmt/rulefmt_test.go b/model/rulefmt/rulefmt_test.go index ec16052bc0..ea8d09af0d 100644 --- a/model/rulefmt/rulefmt_test.go +++ b/model/rulefmt/rulefmt_test.go @@ -21,7 +21,7 @@ import ( "github.com/prometheus/common/model" "github.com/stretchr/testify/require" - "gopkg.in/yaml.v3" + "go.yaml.in/yaml/v3" ) func TestParseFileSuccess(t *testing.T) {