diff --git a/README.md b/README.md index cf10421..625792b 100644 --- a/README.md +++ b/README.md @@ -240,7 +240,7 @@ spec: } ``` -> Note that when returning multiple resources, we need to set different `metadata.name` or `matadata.annotations."krm.kcl.dev/composition-resource-name" ` to distinguish between different resources in the composition functions. +> Note that when returning multiple resources, we need to set different `metadata.name` or `metadata.annotations."krm.kcl.dev/composition-resource-name" ` to distinguish between different resources in the composition functions. ### Target Support diff --git a/fn_test.go b/fn_test.go index 2839f0c..c7f076c 100644 --- a/fn_test.go +++ b/fn_test.go @@ -220,7 +220,7 @@ func TestRunFunctionSimple(t *testing.T) { Results: []*fnv1beta1.Result{ { Severity: fnv1beta1.Severity_SEVERITY_FATAL, - Message: "cannot process xr and state with the pipeline output in *v1beta1.RunFunctionResponse: duplicate resource names custom-composition-resource-name found, when returning multiple resources, you need to set different metadata.name or matadata.annotations.\"krm.kcl.dev/composition-resource-name\" to distinguish between different resources in the composition functions.", + Message: "cannot process xr and state with the pipeline output in *v1beta1.RunFunctionResponse: duplicate resource names custom-composition-resource-name found, when returning multiple resources, you need to set different metadata.name or metadata.annotations.\"krm.kcl.dev/composition-resource-name\" to distinguish between different resources in the composition functions.", }, }}, }, diff --git a/pkg/resource/res.go b/pkg/resource/res.go index cd715a0..60d8f27 100644 --- a/pkg/resource/res.go +++ b/pkg/resource/res.go @@ -496,7 +496,7 @@ func ProcessResources(dxr *resource.Composite, oxr *resource.Composite, desired func CheckAndSetDesired(desired map[resource.Name]*resource.DesiredComposed, checked map[string]struct{}, cd *resource.DesiredComposed) error { name := GetResourceName(cd) if _, existed := checked[name]; existed { - return errors.Errorf("duplicate resource names %s found, when returning multiple resources, you need to set different metadata.name or matadata.annotations.\"krm.kcl.dev/composition-resource-name\" to distinguish between different resources in the composition functions.", name) + return errors.Errorf("duplicate resource names %s found, when returning multiple resources, you need to set different metadata.name or metadata.annotations.\"krm.kcl.dev/composition-resource-name\" to distinguish between different resources in the composition functions.", name) } checked[name] = struct{}{} desired[resource.Name(name)] = cd