diff --git a/examples/default/connection_details/composition.yaml b/examples/default/connection_details/composition.yaml index 669fe0d..c743792 100644 --- a/examples/default/connection_details/composition.yaml +++ b/examples/default/connection_details/composition.yaml @@ -69,3 +69,19 @@ spec: details dxr ] + + # Just for test + - step: normal1 + functionRef: + name: kcl-function + input: + apiVersion: krm.kcl.dev/v1alpha1 + kind: KCLRun + metadata: + name: show-dcds + spec: + source: | + { + metadata.name = "dcds" + dcds: option("params").dcds + } diff --git a/pkg/resource/res.go b/pkg/resource/res.go index ed47d46..5c8cb58 100644 --- a/pkg/resource/res.go +++ b/pkg/resource/res.go @@ -40,7 +40,7 @@ const ( const ( AnnotationKeyReady = "krm.kcl.dev/ready" - MetaApiVersion = "meta.krm.kcl.dev/v1alpha1" + MetaApiVersion = "meta.krm.kcl.dev/v1alpha1" ) type ResourceList []Resource @@ -464,11 +464,7 @@ func ProcessResources(dxr *resource.Composite, oxr *resource.Composite, desired meta.RemoveAnnotations(cd.Resource, AnnotationKeyReady) } // Patch desired with resource meta name. - AddResourcesTo(desired, &AddResourcesOptions{ - Basename: opts.Basename, - Data: []unstructured.Unstructured{obj}, - Overwrite: opts.Overwrite, - }) + desired[resource.Name(cd.Resource.GetName())] = cd } result.Object = data result.MsgCount = len(data)