Skip to content

Commit e9f4b3d

Browse files
authored
[AGENTRUN-1073] Replace gopkg.in/yaml with go.yaml.in/yaml (#46742)
### What does this PR do? Replace `gopkg.in/yaml` with `go.yaml.in/yaml`, for the v2 and v3. Also bumps our viper fork to remove an extra import of the archived yaml lib. ### Motivation `gopkg.in/yaml` has been archived for a long time, `go.yaml.in/yaml` is a maintained fork. The major versions are equivalent. I'm hoping this will help reduce the size increase from bumping `dd-trace-go` to v2 (#46016). ### Describe how you validated your changes CI ### Additional Notes We keep using the same major version (which are not quite compatible), so no risk of breaking change. I might look into replacing v2 with v3 but I remember there were some incompatibilities. Co-authored-by: pierre.gimalac <pierre.gimalac@datadoghq.com>
1 parent f42450a commit e9f4b3d

File tree

443 files changed

+1001
-832
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

443 files changed

+1001
-832
lines changed

cmd/agent/common/import.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ import (
1717
"strings"
1818

1919
"github.com/fatih/color"
20-
yaml "gopkg.in/yaml.v2"
20+
yaml "go.yaml.in/yaml/v2"
2121

2222
secretnooptypes "github.com/DataDog/datadog-agent/comp/core/secrets/noop-impl/types"
2323
"github.com/DataDog/datadog-agent/pkg/config/legacy"

cmd/agent/common/import_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ import (
1414

1515
"github.com/stretchr/testify/assert"
1616
"github.com/stretchr/testify/require"
17-
"gopkg.in/yaml.v2"
17+
"go.yaml.in/yaml/v2"
1818

1919
"github.com/DataDog/datadog-agent/pkg/config/legacy"
2020
"github.com/DataDog/datadog-agent/pkg/config/mock"

cmd/otel-agent/subcommands/flare/command.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ import (
2727
"go.opentelemetry.io/collector/confmap/provider/httpsprovider"
2828
"go.opentelemetry.io/collector/confmap/provider/yamlprovider"
2929
"go.uber.org/fx"
30-
"gopkg.in/yaml.v2"
30+
"go.yaml.in/yaml/v2"
3131

3232
"github.com/DataDog/datadog-agent/cmd/otel-agent/subcommands"
3333
"github.com/DataDog/datadog-agent/comp/core"

cmd/secret-generic-connector/backend/file/yaml.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ import (
1111
"fmt"
1212
"os"
1313

14-
yaml "gopkg.in/yaml.v2"
14+
yaml "go.yaml.in/yaml/v2"
1515

1616
"github.com/mitchellh/mapstructure"
1717

cmd/system-probe/subcommands/usm/config.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ import (
1212
"os"
1313

1414
"github.com/spf13/cobra"
15-
"gopkg.in/yaml.v3"
15+
"go.yaml.in/yaml/v3"
1616

1717
"github.com/DataDog/datadog-agent/cmd/system-probe/command"
1818
sysconfigcomponent "github.com/DataDog/datadog-agent/comp/core/sysprobeconfig"

cmd/system-probe/subcommands/usm/config_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ import (
1212

1313
"github.com/stretchr/testify/assert"
1414
"github.com/stretchr/testify/require"
15-
"gopkg.in/yaml.v3"
15+
"go.yaml.in/yaml/v3"
1616

1717
"github.com/DataDog/datadog-agent/cmd/system-probe/command"
1818
"github.com/DataDog/datadog-agent/pkg/util/fxutil"

cmd/trace-agent/test/agent.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ import (
2525
"time"
2626

2727
"github.com/DataDog/viper"
28-
yaml "gopkg.in/yaml.v2"
28+
yaml "go.yaml.in/yaml/v2"
2929

3030
"google.golang.org/grpc"
3131
"google.golang.org/grpc/credentials"

comp/checks/agentcrashdetect/agentcrashdetectimpl/agentcrashdetect.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,8 @@ import (
1515
"strings"
1616

1717
"go.uber.org/fx"
18+
yaml "go.yaml.in/yaml/v2"
1819
"golang.org/x/sys/windows/registry"
19-
yaml "gopkg.in/yaml.v2"
2020

2121
"github.com/DataDog/datadog-agent/comp/checks/agentcrashdetect"
2222
agenttelemetry "github.com/DataDog/datadog-agent/comp/core/agenttelemetry/def"

comp/checks/windowseventlog/windowseventlogimpl/check/config.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ import (
1212

1313
"github.com/DataDog/datadog-agent/comp/core/autodiscovery/integration"
1414
"github.com/DataDog/datadog-agent/pkg/util/option"
15-
yaml "gopkg.in/yaml.v2"
15+
yaml "go.yaml.in/yaml/v2"
1616
)
1717

1818
const (

comp/checks/windowseventlog/windowseventlogimpl/check/eventdatafilter/config.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ import (
1212
"fmt"
1313

1414
"github.com/Masterminds/semver/v3"
15-
"gopkg.in/yaml.v3"
15+
"go.yaml.in/yaml/v3"
1616
)
1717

1818
const (

0 commit comments

Comments
 (0)