diff --git a/internal/istiooperator/istiooperator_test.go b/internal/istiooperator/istiooperator_test.go index 2fd40d773a..c59bcc70d7 100644 --- a/internal/istiooperator/istiooperator_test.go +++ b/internal/istiooperator/istiooperator_test.go @@ -1,9 +1,9 @@ package istiooperator_test import ( - "encoding/json" meshv1alpha1 "istio.io/api/mesh/v1alpha1" "istio.io/istio/operator/pkg/values" + "istio.io/istio/pkg/util/protomarshal" "os" "path" "regexp" @@ -82,8 +82,7 @@ var _ = Describe("Merge", func() { var meshConfigTyped meshv1alpha1.MeshConfig - meshConfigSnakeCase := jsonTagsToSnakeCase(iop.Spec.MeshConfig) - err = json.Unmarshal([]byte(meshConfigSnakeCase), &meshConfigTyped) + err = protomarshal.Unmarshal(iop.Spec.MeshConfig, &meshConfigTyped) Expect(err).ShouldNot(HaveOccurred()) numTrustedProxies := meshConfigTyped.DefaultConfig.GetGatewayTopology().GetNumTrustedProxies() @@ -131,9 +130,8 @@ var _ = Describe("Merge", func() { iop := readIOP(mergedIstioOperatorPath) var typedMeshConfig meshv1alpha1.MeshConfig - snakeCaseMeshConfig := jsonTagsToSnakeCase(iop.Spec.MeshConfig) - err = json.Unmarshal([]byte(snakeCaseMeshConfig), &typedMeshConfig) + err = protomarshal.Unmarshal(iop.Spec.MeshConfig, &typedMeshConfig) Expect(err).ShouldNot(HaveOccurred()) numTrustedProxies := typedMeshConfig.DefaultConfig.GetGatewayTopology().GetNumTrustedProxies()