From a14794bf5ce856ce97691b5533d403a86033849c Mon Sep 17 00:00:00 2001 From: Stefan Haller Date: Thu, 8 Jun 2023 08:38:46 +0200 Subject: [PATCH] Rename UpdateYaml to UpdateYamlValue We are going to add other ways to update yaml documents in the future. --- pkg/utils/yaml_utils/yaml_utils.go | 2 +- pkg/utils/yaml_utils/yaml_utils_test.go | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/pkg/utils/yaml_utils/yaml_utils.go b/pkg/utils/yaml_utils/yaml_utils.go index 9ed7ae875..2a490f903 100644 --- a/pkg/utils/yaml_utils/yaml_utils.go +++ b/pkg/utils/yaml_utils/yaml_utils.go @@ -7,7 +7,7 @@ import ( ) // takes a yaml document in bytes, a path to a key, and a value to set. The value must be a scalar. -func UpdateYaml(yamlBytes []byte, path []string, value string) ([]byte, error) { +func UpdateYamlValue(yamlBytes []byte, path []string, value string) ([]byte, error) { // Parse the YAML file. var node yaml.Node err := yaml.Unmarshal(yamlBytes, &node) diff --git a/pkg/utils/yaml_utils/yaml_utils_test.go b/pkg/utils/yaml_utils/yaml_utils_test.go index 518907cb1..ff39cbe3f 100644 --- a/pkg/utils/yaml_utils/yaml_utils_test.go +++ b/pkg/utils/yaml_utils/yaml_utils_test.go @@ -6,7 +6,7 @@ import ( "github.com/stretchr/testify/assert" ) -func TestUpdateYaml(t *testing.T) { +func TestUpdateYamlValue(t *testing.T) { tests := []struct { name string in string @@ -53,7 +53,7 @@ func TestUpdateYaml(t *testing.T) { for _, test := range tests { test := test t.Run(test.name, func(t *testing.T) { - out, actualErr := UpdateYaml([]byte(test.in), test.path, test.value) + out, actualErr := UpdateYamlValue([]byte(test.in), test.path, test.value) if test.expectedErr == "" { assert.NoError(t, actualErr) } else {