web: switch from gopkg.in/yaml to go.yaml.in/yaml (#17979)

Replace gopkg.in/yaml.v2 and gopkg.in/yaml.v3 imports with
go.yaml.in/yaml/v2 and go.yaml.in/yaml/v3 respectively.

Signed-off-by: Arve Knudsen <arve.knudsen@gmail.com>
This commit is contained in:
Arve Knudsen 2026-02-03 15:15:35 +01:00 committed by GitHub
parent c0ad853750
commit 51d33be878
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
4 changed files with 8 additions and 4 deletions

View file

@ -102,6 +102,10 @@ linters:
desc: "Use github.com/klauspost/compress instead of zlib" desc: "Use github.com/klauspost/compress instead of zlib"
- pkg: "golang.org/x/exp/slices" - pkg: "golang.org/x/exp/slices"
desc: "Use 'slices' instead." desc: "Use 'slices' instead."
- pkg: "gopkg.in/yaml.v2"
desc: "Use go.yaml.in/yaml/v2 instead of gopkg.in/yaml.v2"
- pkg: "gopkg.in/yaml.v3"
desc: "Use go.yaml.in/yaml/v3 instead of gopkg.in/yaml.v3"
errcheck: errcheck:
exclude-functions: exclude-functions:
# Don't flag lines such as "io.Copy(io.Discard, resp.Body)". # Don't flag lines such as "io.Copy(io.Discard, resp.Body)".

4
go.mod
View file

@ -96,7 +96,6 @@ require (
google.golang.org/genproto/googleapis/api v0.0.0-20251222181119-0a764e51fe1b google.golang.org/genproto/googleapis/api v0.0.0-20251222181119-0a764e51fe1b
google.golang.org/grpc v1.78.0 google.golang.org/grpc v1.78.0
google.golang.org/protobuf v1.36.11 google.golang.org/protobuf v1.36.11
gopkg.in/yaml.v3 v3.0.1
k8s.io/api v0.34.3 k8s.io/api v0.34.3
k8s.io/apimachinery v0.34.3 k8s.io/apimachinery v0.34.3
k8s.io/client-go v0.34.3 k8s.io/client-go v0.34.3
@ -124,6 +123,8 @@ require (
github.com/pb33f/ordered-map/v2 v2.3.0 // indirect github.com/pb33f/ordered-map/v2 v2.3.0 // indirect
github.com/santhosh-tekuri/jsonschema/v6 v6.0.2 // indirect github.com/santhosh-tekuri/jsonschema/v6 v6.0.2 // indirect
go.uber.org/multierr v1.11.0 // indirect go.uber.org/multierr v1.11.0 // indirect
gopkg.in/yaml.v2 v2.4.0 // indirect
gopkg.in/yaml.v3 v3.0.1 // indirect
sigs.k8s.io/structured-merge-diff/v6 v6.3.0 // indirect sigs.k8s.io/structured-merge-diff/v6 v6.3.0 // indirect
) )
@ -246,7 +247,6 @@ require (
gopkg.in/evanphx/json-patch.v4 v4.12.0 // indirect gopkg.in/evanphx/json-patch.v4 v4.12.0 // indirect
gopkg.in/inf.v0 v0.9.1 // indirect gopkg.in/inf.v0 v0.9.1 // indirect
gopkg.in/ini.v1 v1.67.0 // indirect gopkg.in/ini.v1 v1.67.0 // indirect
gopkg.in/yaml.v2 v2.4.0
gotest.tools/v3 v3.0.3 // indirect gotest.tools/v3 v3.0.3 // indirect
k8s.io/kube-openapi v0.0.0-20250710124328-f3f2b991d03b // indirect k8s.io/kube-openapi v0.0.0-20250710124328-f3f2b991d03b // indirect
k8s.io/utils v0.0.0-20250604170112-4c0f3b243397 // indirect k8s.io/utils v0.0.0-20250604170112-4c0f3b243397 // indirect

View file

@ -20,7 +20,7 @@ import (
"testing" "testing"
"github.com/stretchr/testify/require" "github.com/stretchr/testify/require"
"gopkg.in/yaml.v3" "go.yaml.in/yaml/v3"
"github.com/prometheus/prometheus/web/api/testhelpers" "github.com/prometheus/prometheus/web/api/testhelpers"
) )

View file

@ -21,7 +21,7 @@ import (
"github.com/prometheus/common/promslog" "github.com/prometheus/common/promslog"
"github.com/stretchr/testify/require" "github.com/stretchr/testify/require"
"gopkg.in/yaml.v2" "go.yaml.in/yaml/v2"
) )
// TestOpenAPIHTTPHandler verifies that the OpenAPI endpoint serves a valid specification // TestOpenAPIHTTPHandler verifies that the OpenAPI endpoint serves a valid specification