diff --git a/operator/product-helm-chart/values.yaml b/operator/product-helm-chart/values.yaml index 8544eada..882ac6bd 100644 --- a/operator/product-helm-chart/values.yaml +++ b/operator/product-helm-chart/values.yaml @@ -12,7 +12,6 @@ resources: sidecarInjector: enabled: false namespace: cnpg-system - namespace: cnpg-system image: repository: "" digest: "" diff --git a/operator/src/internal/product/chart_values_test.go b/operator/src/internal/product/chart_values_test.go new file mode 100644 index 00000000..739e5790 --- /dev/null +++ b/operator/src/internal/product/chart_values_test.go @@ -0,0 +1,28 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +package product + +import ( + "os" + "path/filepath" + "testing" + + "sigs.k8s.io/yaml" +) + +func TestChartValuesAreStrictYAML(t *testing.T) { + for _, chart := range []string{"documentdb-helm-chart", "product-helm-chart"} { + t.Run(chart, func(t *testing.T) { + path := filepath.Join("../../../", chart, "values.yaml") + data, err := os.ReadFile(path) + if err != nil { + t.Fatal(err) + } + var values map[string]any + if err := yaml.UnmarshalStrict(data, &values); err != nil { + t.Fatalf("%s must not contain duplicate YAML keys: %v", path, err) + } + }) + } +}