chore(deps): Switch to maintained gopkg.in/yaml fork (#114131)

Signed-off-by: Dave Henderson <dave.henderson@grafana.com>
This commit is contained in:
Dave Henderson
2025-11-19 15:20:32 -05:00
committed by GitHub
parent 84d6f54daa
commit 7264803016
41 changed files with 50 additions and 48 deletions
+3 -1
View File
@@ -181,7 +181,9 @@ linters:
- pkg: io/ioutil
desc: 'Deprecated: As of Go 1.16, the same functionality is now provided by package io or package os, and those implementations should be preferred in new code. See the specific function documentation for details.'
- pkg: gopkg.in/yaml.v2
desc: Grafana packages are not allowed to depend on gopkg.in/yaml.v2 as gopkg.in/yaml.v3 is now available
desc: use go.yaml.in/yaml/v3 instead
- pkg: gopkg.in/yaml.v3
desc: use go.yaml.in/yaml/v3 instead
- pkg: github.com/pkg/errors
desc: 'Deprecated: Go 1.13 supports the functionality provided by pkg/errors in the standard library.'
- pkg: github.com/xorcare/pointer
+2 -2
View File
@@ -6,9 +6,9 @@ require (
github.com/grafana/grafana-app-sdk v0.48.2
github.com/grafana/grafana/pkg/apimachinery v0.0.0-20250710134100-1f3dc0533caf
github.com/stretchr/testify v1.11.1
go.yaml.in/yaml/v3 v3.0.4
google.golang.org/grpc v1.76.0
google.golang.org/protobuf v1.36.10
gopkg.in/yaml.v3 v3.0.1
k8s.io/apimachinery v0.34.2
k8s.io/kube-openapi v0.0.0-20250910181357-589584f1c912
k8s.io/utils v0.0.0-20250604170112-4c0f3b243397
@@ -54,7 +54,6 @@ require (
go.opentelemetry.io/otel/sdk/metric v1.38.0 // indirect
go.opentelemetry.io/otel/trace v1.38.0 // indirect
go.yaml.in/yaml/v2 v2.4.3 // indirect
go.yaml.in/yaml/v3 v3.0.4 // indirect
golang.org/x/net v0.47.0 // indirect
golang.org/x/oauth2 v0.33.0 // indirect
golang.org/x/sys v0.38.0 // indirect
@@ -63,6 +62,7 @@ require (
golang.org/x/time v0.14.0 // indirect
google.golang.org/genproto/googleapis/rpc v0.0.0-20251002232023-7c0ddcbb5797 // indirect
gopkg.in/inf.v0 v0.9.1 // indirect
gopkg.in/yaml.v3 v3.0.1 // indirect
k8s.io/client-go v0.34.2 // indirect
k8s.io/klog/v2 v2.130.1 // indirect
sigs.k8s.io/json v0.0.0-20241014173422-cfa47c3a1cc8 // indirect
@@ -9,7 +9,7 @@ import (
"fmt"
"strconv"
"gopkg.in/yaml.v3"
"go.yaml.in/yaml/v3"
)
const redacted = "[REDACTED]"
@@ -11,7 +11,7 @@ import (
"testing"
"github.com/stretchr/testify/require"
"gopkg.in/yaml.v3"
"go.yaml.in/yaml/v3"
)
func TestExposedSecureValue(t *testing.T) {
+1 -1
View File
@@ -13,7 +13,7 @@ import (
"os"
"strings"
"gopkg.in/yaml.v3"
"go.yaml.in/yaml/v3"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
"github.com/grafana/grafana/apps/scope/pkg/apis/scope/v0alpha1"
+4 -4
View File
@@ -197,6 +197,8 @@ require (
go.uber.org/goleak v1.3.0 // @grafana/grafana-search-and-storage
go.uber.org/mock v0.6.0 // @grafana/grafana-operator-experience-squad
go.uber.org/zap v1.27.0 // @grafana/identity-access-team
go.yaml.in/yaml/v2 v2.4.3 // @grafana/alerting-backend
go.yaml.in/yaml/v3 v3.0.4 // @grafana/alerting-backend
gocloud.dev v0.43.0 // @grafana/grafana-app-platform-squad
gocloud.dev/secrets/hashivault v0.43.0 // @grafana/grafana-operator-experience-squad
golang.org/x/crypto v0.44.0 // @grafana/grafana-backend-group
@@ -214,8 +216,6 @@ require (
google.golang.org/protobuf v1.36.10 // @grafana/plugins-platform-backend
gopkg.in/ini.v1 v1.67.0 // @grafana/alerting-backend
gopkg.in/mail.v2 v2.3.1 // @grafana/grafana-backend-group
gopkg.in/yaml.v2 v2.4.0 // @grafana/alerting-backend
gopkg.in/yaml.v3 v3.0.1 // @grafana/alerting-backend
k8s.io/api v0.34.2 // @grafana/grafana-app-platform-squad
k8s.io/apimachinery v0.34.2 // @grafana/grafana-app-platform-squad
k8s.io/apiserver v0.34.2 // @grafana/grafana-app-platform-squad
@@ -628,8 +628,6 @@ require (
go.opentelemetry.io/otel/sdk/metric v1.38.0 // indirect
go.opentelemetry.io/proto/otlp v1.7.1 // indirect
go.uber.org/multierr v1.11.0 // indirect
go.yaml.in/yaml/v2 v2.4.3 // indirect
go.yaml.in/yaml/v3 v3.0.4 // indirect
go4.org/netipx v0.0.0-20230125063823-8449b0a6169f // indirect
golang.org/x/sys v0.38.0 // indirect
golang.org/x/telemetry v0.0.0-20251111182119-bc8e575c7b54 // indirect
@@ -647,6 +645,8 @@ require (
gopkg.in/natefinch/lumberjack.v2 v2.2.1 // indirect
gopkg.in/src-d/go-errors.v1 v1.0.0 // indirect
gopkg.in/telebot.v3 v3.3.8 // indirect
gopkg.in/yaml.v2 v2.4.0 // indirect
gopkg.in/yaml.v3 v3.0.1 // indirect
k8s.io/apiextensions-apiserver v0.34.2 // indirect
k8s.io/kms v0.34.2 // indirect
modernc.org/libc v1.66.10 // indirect
+1 -1
View File
@@ -10,7 +10,7 @@ import (
"reflect"
jsoniter "github.com/json-iterator/go"
"gopkg.in/yaml.v3"
"go.yaml.in/yaml/v3"
"github.com/grafana/grafana/pkg/apimachinery/errutil"
"github.com/grafana/grafana/pkg/infra/tracing"
@@ -5,7 +5,7 @@ import (
"fmt"
"strconv"
"gopkg.in/yaml.v3"
"go.yaml.in/yaml/v3"
openapi "k8s.io/kube-openapi/pkg/common"
spec "k8s.io/kube-openapi/pkg/validation/spec"
ptr "k8s.io/utils/ptr"
@@ -7,7 +7,7 @@ import (
"testing"
"github.com/stretchr/testify/require"
"gopkg.in/yaml.v3"
"go.yaml.in/yaml/v3"
"k8s.io/kube-openapi/pkg/validation/strfmt"
"k8s.io/kube-openapi/pkg/validation/validate"
+3 -4
View File
@@ -3,18 +3,17 @@ module github.com/grafana/grafana/pkg/apimachinery
go 1.25.3
require (
github.com/go-jose/go-jose/v4 v4.1.2
github.com/grafana/authlib v0.0.0-20250930082137-a40e2c2b094f // @grafana/identity-access-team
github.com/grafana/authlib/types v0.0.0-20250926065801-df98203cff37 // @grafana/identity-access-team
github.com/stretchr/testify v1.11.1
gopkg.in/yaml.v3 v3.0.1
go.yaml.in/yaml/v3 v3.0.4
k8s.io/apimachinery v0.34.2
k8s.io/apiserver v0.34.2
k8s.io/kube-openapi v0.0.0-20250910181357-589584f1c912
k8s.io/utils v0.0.0-20250604170112-4c0f3b243397
)
require github.com/go-jose/go-jose/v4 v4.1.2
require (
github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc // indirect
github.com/emicklei/go-restful/v3 v3.13.0 // indirect
@@ -44,7 +43,6 @@ require (
go.opentelemetry.io/otel/metric v1.38.0 // indirect
go.opentelemetry.io/otel/trace v1.38.0 // indirect
go.yaml.in/yaml/v2 v2.4.3 // indirect
go.yaml.in/yaml/v3 v3.0.4 // indirect
golang.org/x/crypto v0.44.0 // indirect
golang.org/x/net v0.47.0 // indirect
golang.org/x/sync v0.18.0 // indirect
@@ -54,6 +52,7 @@ require (
google.golang.org/grpc v1.76.0 // indirect
google.golang.org/protobuf v1.36.10 // indirect
gopkg.in/inf.v0 v0.9.1 // indirect
gopkg.in/yaml.v3 v3.0.1 // indirect
k8s.io/klog/v2 v2.130.1 // indirect
sigs.k8s.io/json v0.0.0-20241014173422-cfa47c3a1cc8 // indirect
sigs.k8s.io/randfill v1.0.0 // indirect
@@ -8,7 +8,7 @@ import (
"path"
"go.opentelemetry.io/otel/attribute"
"gopkg.in/yaml.v3"
"go.yaml.in/yaml/v3"
apierrors "k8s.io/apimachinery/pkg/api/errors"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
"k8s.io/apimachinery/pkg/apis/meta/v1/unstructured"
@@ -16,6 +16,7 @@ import (
"k8s.io/client-go/dynamic"
"github.com/grafana/grafana-app-sdk/logging"
dashboard "github.com/grafana/grafana/apps/dashboard/pkg/apis/dashboard/v0alpha1"
provisioning "github.com/grafana/grafana/apps/provisioning/pkg/apis/provisioning/v0alpha1"
"github.com/grafana/grafana/apps/provisioning/pkg/repository"
@@ -15,7 +15,7 @@ import (
amconfig "github.com/prometheus/alertmanager/config"
"github.com/prometheus/alertmanager/pkg/labels"
prommodel "github.com/prometheus/common/model"
"gopkg.in/yaml.v3"
"go.yaml.in/yaml/v3"
"github.com/grafana/grafana/pkg/api/response"
"github.com/grafana/grafana/pkg/apimachinery/errutil"
@@ -15,7 +15,7 @@ import (
prommodel "github.com/prometheus/common/model"
"github.com/stretchr/testify/mock"
"github.com/stretchr/testify/require"
"gopkg.in/yaml.v3"
"go.yaml.in/yaml/v3"
"github.com/grafana/grafana/pkg/apimachinery/identity"
"github.com/grafana/grafana/pkg/infra/log"
+1 -1
View File
@@ -8,7 +8,7 @@ import (
"io"
"net/http"
"gopkg.in/yaml.v3"
"go.yaml.in/yaml/v3"
"github.com/grafana/grafana/pkg/api/response"
"github.com/grafana/grafana/pkg/infra/log"
+1 -1
View File
@@ -7,7 +7,7 @@ import (
"net/http"
"net/url"
"gopkg.in/yaml.v3"
"go.yaml.in/yaml/v3"
"github.com/grafana/grafana/pkg/api/response"
"github.com/grafana/grafana/pkg/infra/log"
@@ -5,7 +5,7 @@ import (
"io"
"mime"
"gopkg.in/yaml.v3"
"go.yaml.in/yaml/v3"
"github.com/grafana/grafana/pkg/api/response"
"github.com/grafana/grafana/pkg/apimachinery/errutil"
@@ -13,7 +13,7 @@ import (
"github.com/prometheus/alertmanager/config"
"github.com/prometheus/alertmanager/pkg/labels"
"github.com/prometheus/common/model"
"gopkg.in/yaml.v3"
"go.yaml.in/yaml/v3"
"github.com/grafana/alerting/definition"
alertingmodels "github.com/grafana/alerting/models"
@@ -14,7 +14,7 @@ import (
"github.com/prometheus/common/model"
"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/require"
"gopkg.in/yaml.v3"
"go.yaml.in/yaml/v3"
)
//go:embed test-data/*.*
@@ -6,7 +6,7 @@ import (
"strings"
"github.com/grafana/alerting/templates"
"gopkg.in/yaml.v3"
"go.yaml.in/yaml/v3"
)
func (t *NotificationTemplate) Validate() error {
@@ -6,7 +6,7 @@ import (
"github.com/prometheus/common/model"
"github.com/stretchr/testify/require"
"gopkg.in/yaml.v3"
"go.yaml.in/yaml/v3"
)
func Test_Rule_Marshaling(t *testing.T) {
@@ -5,7 +5,7 @@ import (
"testing"
"github.com/stretchr/testify/require"
"gopkg.in/yaml.v3"
"go.yaml.in/yaml/v3"
)
func TestNotificationPolicyExportMarshal(t *testing.T) {
+1 -1
View File
@@ -13,7 +13,7 @@ import (
"strconv"
"strings"
"gopkg.in/yaml.v3"
"go.yaml.in/yaml/v3"
"github.com/grafana/grafana/pkg/api/response"
"github.com/grafana/grafana/pkg/services/accesscontrol"
@@ -15,8 +15,8 @@ import (
"github.com/prometheus/common/model"
"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/require"
"go.yaml.in/yaml/v3"
"golang.org/x/exp/maps"
"gopkg.in/yaml.v3"
"github.com/grafana/grafana/pkg/setting"
"github.com/grafana/grafana/pkg/util"
+1 -1
View File
@@ -6,7 +6,7 @@ import (
"time"
"github.com/google/uuid"
"gopkg.in/yaml.v3"
"go.yaml.in/yaml/v3"
"github.com/grafana/grafana/pkg/apimachinery/errutil"
"github.com/grafana/grafana/pkg/services/datasources"
+1 -1
View File
@@ -10,7 +10,7 @@ import (
"github.com/google/uuid"
prommodel "github.com/prometheus/common/model"
"github.com/stretchr/testify/require"
"gopkg.in/yaml.v3"
"go.yaml.in/yaml/v3"
"github.com/grafana/grafana/pkg/expr"
"github.com/grafana/grafana/pkg/expr/mathexp"
+1 -1
View File
@@ -6,7 +6,7 @@ import (
prommodel "github.com/prometheus/common/model"
"github.com/stretchr/testify/require"
"gopkg.in/yaml.v3"
"go.yaml.in/yaml/v3"
"github.com/grafana/grafana/pkg/util"
)
+1 -1
View File
@@ -30,7 +30,7 @@ import (
"github.com/prometheus/alertmanager/pkg/labels"
"github.com/prometheus/client_golang/prometheus"
common_config "github.com/prometheus/common/config"
"gopkg.in/yaml.v3"
"go.yaml.in/yaml/v3"
"github.com/grafana/grafana/pkg/infra/log"
"github.com/grafana/grafana/pkg/infra/tracing"
@@ -27,12 +27,12 @@ import (
"github.com/prometheus/client_golang/prometheus"
common_config "github.com/prometheus/common/config"
"github.com/stretchr/testify/require"
"go.yaml.in/yaml/v3"
alertingClusterPB "github.com/grafana/alerting/cluster/clusterpb"
"github.com/grafana/alerting/definition"
alertingModels "github.com/grafana/alerting/models"
"github.com/grafana/alerting/notify"
"gopkg.in/yaml.v3"
"github.com/grafana/grafana/pkg/infra/db"
"github.com/grafana/grafana/pkg/infra/log"
+1 -1
View File
@@ -38,7 +38,7 @@ import (
"github.com/prometheus/common/promslog"
"github.com/prometheus/common/version"
"github.com/prometheus/sigv4"
"gopkg.in/yaml.v2"
"go.yaml.in/yaml/v3"
"github.com/prometheus/prometheus/config"
"github.com/prometheus/prometheus/discovery/targetgroup"
+1 -1
View File
@@ -38,7 +38,7 @@ import (
"github.com/prometheus/common/promslog"
"github.com/stretchr/testify/require"
"go.uber.org/atomic"
"gopkg.in/yaml.v2"
"go.yaml.in/yaml/v2"
"github.com/prometheus/prometheus/config"
"github.com/prometheus/prometheus/discovery"
@@ -8,7 +8,7 @@ import (
"path/filepath"
"strings"
"gopkg.in/yaml.v3"
"go.yaml.in/yaml/v3"
"github.com/grafana/grafana/pkg/infra/log"
)
@@ -4,7 +4,7 @@ import (
"testing"
"github.com/stretchr/testify/require"
"gopkg.in/yaml.v3"
"go.yaml.in/yaml/v3"
"github.com/grafana/grafana/pkg/services/provisioning/values"
)
@@ -4,7 +4,7 @@ import (
"testing"
"github.com/stretchr/testify/require"
"gopkg.in/yaml.v3"
"go.yaml.in/yaml/v3"
)
func TestNotificationPolicy(t *testing.T) {
@@ -6,7 +6,7 @@ import (
"github.com/prometheus/common/model"
"github.com/stretchr/testify/require"
"gopkg.in/yaml.v3"
"go.yaml.in/yaml/v3"
"github.com/grafana/grafana/pkg/services/ngalert/models"
"github.com/grafana/grafana/pkg/services/provisioning/values"
@@ -8,7 +8,7 @@ import (
"path/filepath"
"strings"
"gopkg.in/yaml.v3"
"go.yaml.in/yaml/v3"
"github.com/grafana/grafana/pkg/infra/log"
"github.com/grafana/grafana/pkg/services/provisioning/utils"
@@ -8,7 +8,7 @@ import (
"path/filepath"
"strings"
"gopkg.in/yaml.v3"
"go.yaml.in/yaml/v3"
"github.com/grafana/grafana/pkg/infra/log"
"github.com/grafana/grafana/pkg/services/datasources"
@@ -9,7 +9,7 @@ import (
"path/filepath"
"strings"
"gopkg.in/yaml.v3"
"go.yaml.in/yaml/v3"
"github.com/grafana/grafana/pkg/infra/log"
"github.com/grafana/grafana/pkg/services/pluginsintegration/pluginstore"
@@ -8,8 +8,8 @@ import (
"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/require"
"go.yaml.in/yaml/v3"
"gopkg.in/ini.v1"
"gopkg.in/yaml.v3"
"github.com/grafana/grafana/pkg/setting"
)
@@ -7,7 +7,7 @@ import (
"github.com/google/go-cmp/cmp"
"github.com/stretchr/testify/require"
"gopkg.in/yaml.v3"
"go.yaml.in/yaml/v3"
"github.com/grafana/grafana/pkg/services/featuremgmt"
apimodels "github.com/grafana/grafana/pkg/services/ngalert/api/tooling/definitions"
@@ -20,7 +20,7 @@ import (
"github.com/prometheus/common/model"
"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/require"
"gopkg.in/yaml.v3"
"go.yaml.in/yaml/v3"
"github.com/grafana/grafana/pkg/apimachinery/errutil"
"github.com/grafana/grafana/pkg/expr"
+1 -1
View File
@@ -17,7 +17,7 @@ import (
"github.com/prometheus/common/model"
"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/require"
"gopkg.in/yaml.v3"
"go.yaml.in/yaml/v3"
"github.com/grafana/grafana/pkg/api"
"github.com/grafana/grafana/pkg/configprovider"