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 <superq@gmail.com>
This commit is contained in:
Ben Kochie 2026-01-22 16:36:30 +01:00 committed by GitHub
parent 9a49316c59
commit 9b549fa118
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
4 changed files with 5 additions and 5 deletions

View file

@ -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) {

4
go.mod
View file

@ -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
)

View file

@ -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"

View file

@ -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) {