@@ -11,10 +11,10 @@ import (
1111 "testing"
1212
1313 "github.com/go-logr/logr"
14+ go_yaml "github.com/goccy/go-yaml"
1415 "github.com/google/go-cmp/cmp"
1516 "github.com/stretchr/testify/assert"
1617 "github.com/stretchr/testify/require"
17- "gopkg.in/yaml.v3"
1818 appsv1 "k8s.io/api/apps/v1"
1919 authv1 "k8s.io/api/authorization/v1"
2020 autoscalingv2 "k8s.io/api/autoscaling/v2"
@@ -142,7 +142,7 @@ func TestCollectorDefaultingWebhook(t *testing.T) {
142142 Config : func () v1beta1.Config {
143143 const input = `{"receivers":{"otlp":{"protocols":{"grpc":null,"http":null}}},"exporters":{"debug":null},"service":{"pipelines":{"traces":{"receivers":["otlp"],"exporters":["debug"]}}}}`
144144 var cfg v1beta1.Config
145- require .NoError (t , yaml .Unmarshal ([]byte (input ), & cfg ))
145+ require .NoError (t , go_yaml .Unmarshal ([]byte (input ), & cfg ))
146146 return cfg
147147 }(),
148148 },
@@ -161,7 +161,7 @@ func TestCollectorDefaultingWebhook(t *testing.T) {
161161 Config : func () v1beta1.Config {
162162 const input = `{"receivers":{"otlp":{"protocols":{"grpc":{"endpoint":"0.0.0.0:4317"},"http":{"endpoint":"0.0.0.0:4318"}}}},"exporters":{"debug":null},"service":{"telemetry":{"metrics":{"readers":[{"pull":{"exporter":{"prometheus":{"host":"0.0.0.0","port":8888}}}}]}},"pipelines":{"traces":{"receivers":["otlp"],"exporters":["debug"]}}}}`
163163 var cfg v1beta1.Config
164- require .NoError (t , yaml .Unmarshal ([]byte (input ), & cfg ))
164+ require .NoError (t , go_yaml .Unmarshal ([]byte (input ), & cfg ))
165165 // This is a workaround to avoid the type mismatch because how go-yaml unmarshals
166166 cfg .Service .Telemetry .Object ["metrics" ].(map [string ]interface {})["readers" ].([]interface {})[0 ].(map [string ]interface {})["pull" ].(map [string ]interface {})["exporter" ].(map [string ]interface {})["prometheus" ].(map [string ]interface {})["port" ] = int32 (8888 )
167167 return cfg
@@ -176,7 +176,7 @@ func TestCollectorDefaultingWebhook(t *testing.T) {
176176 Config : func () v1beta1.Config {
177177 const input = `{"receivers":{"otlp":{"protocols":{"grpc":{"headers":{"example":"another"}},"http":{"endpoint":"0.0.0.0:4000"}}}},"exporters":{"debug":null},"service":{"telemetry":{"metrics":{"readers":[{"pull":{"exporter":{"prometheus":{"host":"localhost","port":9999}}}}]}},"pipelines":{"traces":{"receivers":["otlp"],"exporters":["debug"]}}}}`
178178 var cfg v1beta1.Config
179- require .NoError (t , yaml .Unmarshal ([]byte (input ), & cfg ))
179+ require .NoError (t , go_yaml .Unmarshal ([]byte (input ), & cfg ))
180180 return cfg
181181 }(),
182182 },
@@ -195,7 +195,7 @@ func TestCollectorDefaultingWebhook(t *testing.T) {
195195 Config : func () v1beta1.Config {
196196 const input = `{"receivers":{"otlp":{"protocols":{"grpc":{"endpoint":"0.0.0.0:4317","headers":{"example":"another"}},"http":{"endpoint":"0.0.0.0:4000"}}}},"exporters":{"debug":null},"service":{"telemetry":{"metrics":{"readers":[{"pull":{"exporter":{"prometheus":{"host":"localhost","port":9999}}}}]}},"pipelines":{"traces":{"receivers":["otlp"],"exporters":["debug"]}}}}`
197197 var cfg v1beta1.Config
198- require .NoError (t , yaml .Unmarshal ([]byte (input ), & cfg ))
198+ require .NoError (t , go_yaml .Unmarshal ([]byte (input ), & cfg ))
199199 return cfg
200200 }(),
201201 },
@@ -604,7 +604,7 @@ func TestOTELColValidatingWebhook(t *testing.T) {
604604 },
605605 },
606606 }
607- err := yaml .Unmarshal ([]byte (cfgYaml ), & cfg )
607+ err := go_yaml .Unmarshal ([]byte (cfgYaml ), & cfg )
608608 require .NoError (t , err )
609609
610610 tests := []struct { //nolint:govet
0 commit comments