Skip to content

Commit 9016431

Browse files
authored
[AGENTRUN-1073] Replace github.com/goccy/go-yaml with go.yaml.in/yaml/v3 (#46070)
### What does this PR do? Replace `github.com/goccy/go-yaml` with `go.yaml.in/yaml/v3`. ### Motivation Remove one of our many yaml dependencies. ### Describe how you validated your changes CI should be enough. ### Additional Notes Follow-up PRs will hopefully remove other yaml dependencies. Co-authored-by: pierre.gimalac <pierre.gimalac@datadoghq.com>
1 parent 14fab6d commit 9016431

File tree

6 files changed

+7
-7
lines changed

6 files changed

+7
-7
lines changed

comp/host-profiler/collector/impl/extensions/hpflareextension/extension.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,12 +14,12 @@ import (
1414
"net/http"
1515

1616
ipc "github.com/DataDog/datadog-agent/comp/core/ipc/def"
17-
"github.com/goccy/go-yaml"
1817
"go.opentelemetry.io/collector/component"
1918
"go.opentelemetry.io/collector/component/componentstatus"
2019
"go.opentelemetry.io/collector/confmap"
2120
"go.opentelemetry.io/collector/extension/extensioncapabilities"
2221
"go.uber.org/zap"
22+
"go.yaml.in/yaml/v3"
2323
)
2424

2525
var _ extensioncapabilities.ConfigWatcher = (*DDExtension)(nil)

go.mod

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -919,7 +919,7 @@ require (
919919
go.uber.org/goleak v1.3.0
920920
go.uber.org/zap/exp v0.3.0
921921
go.yaml.in/yaml/v2 v2.4.3 // indirect
922-
go.yaml.in/yaml/v3 v3.0.4 // indirect
922+
go.yaml.in/yaml/v3 v3.0.4
923923
go4.org/unsafe/assume-no-moving-gc v0.0.0-20231121144256-b99613f794b6 // indirect
924924
golang.org/x/exp/typeparams v0.0.0-20251125195548-87e1e737ad39 // indirect
925925
golang.org/x/lint v0.0.0-20241112194109-818c5a804067 // indirect

pkg/dyninst/gotype/gotypeprinter/printer.go

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

19-
"github.com/goccy/go-yaml"
19+
"go.yaml.in/yaml/v3"
2020

2121
"github.com/DataDog/datadog-agent/pkg/dyninst/gotype"
2222
)

pkg/dyninst/gotype/snapshot_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -100,6 +100,6 @@ func runGoTypeSnapshot(t *testing.T, cfg testprogs.Config, prog string) {
100100
outputFile := path.Join(snapshotDir, prog+"."+cfg.String()+".yaml")
101101
expected, err := os.ReadFile(outputFile)
102102
require.NoError(t, err)
103-
require.Equal(t, string(expected), string(marshaled))
103+
require.YAMLEq(t, string(expected), string(marshaled))
104104
}
105105
}

test/new-e2e/go.mod

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -226,9 +226,9 @@ require (
226226
github.com/aws/aws-sdk-go-v2/service/s3 v1.93.1
227227
github.com/digitalocean/go-libvirt v0.0.0-20240812180835-9c6c0a310c6c
228228
github.com/go-viper/mapstructure/v2 v2.5.0
229-
github.com/goccy/go-yaml v1.19.2
230229
github.com/google/go-containerregistry v0.20.7
231230
github.com/hairyhenderson/go-codeowners v0.7.0
231+
go.yaml.in/yaml/v3 v3.0.4
232232
)
233233

234234
require (
@@ -292,6 +292,7 @@ require (
292292
github.com/erikgeiser/coninput v0.0.0-20211004153227-1c3628e74d0f // indirect
293293
github.com/fxamacker/cbor/v2 v2.9.0 // indirect
294294
github.com/go-ole/go-ole v1.3.0 // indirect
295+
github.com/goccy/go-yaml v1.19.2 // indirect
295296
github.com/google/go-tpm v0.9.8 // indirect
296297
github.com/hashicorp/go-version v1.8.0 // indirect
297298
github.com/iwdgo/sigintwindows v0.2.2 // indirect
@@ -350,7 +351,6 @@ require (
350351
go.uber.org/multierr v1.11.0 // indirect
351352
go.uber.org/zap v1.27.1 // indirect
352353
go.yaml.in/yaml/v2 v2.4.3 // indirect
353-
go.yaml.in/yaml/v3 v3.0.4 // indirect
354354
golang.org/x/xerrors v0.0.0-20240903120638-7835f813f4da // indirect
355355
gopkg.in/evanphx/json-patch.v4 v4.12.0 // indirect
356356
gopkg.in/ini.v1 v1.67.0 // indirect

test/new-e2e/tests/fleet/agent/agent.go

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

1717
"github.com/avast/retry-go/v4"
18-
"github.com/goccy/go-yaml"
1918
"github.com/stretchr/testify/require"
19+
"go.yaml.in/yaml/v3"
2020

2121
e2eos "github.com/DataDog/datadog-agent/test/e2e-framework/components/os"
2222

0 commit comments

Comments
 (0)