Skip to content

Commit

Permalink
feat: add dcds show example and format the document
Browse files Browse the repository at this point in the history
Signed-off-by: peefy <xpf6677@163.com>
  • Loading branch information
Peefy committed Apr 3, 2024
1 parent 386ebbe commit 610d708
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 6 deletions.
16 changes: 16 additions & 0 deletions examples/default/connection_details/composition.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
8 changes: 2 additions & 6 deletions pkg/resource/res.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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)
Expand Down

0 comments on commit 610d708

Please sign in to comment.