diff --git a/README.md b/README.md index cf0724a..7d551f1 100644 --- a/README.md +++ b/README.md @@ -8,6 +8,8 @@ Crossplane KCL function allows developers to use [KCL](https://kcl-lang.io/) (a DSL) to write composite logic without the need for repeated packaging of crossplane functions, and we support package management and the [KRM KCL specification](https://github.com/kcl-lang/krm-kcl), which allows for OCI/Git source and the reuse of [KCL's module ecosystem](https://artifacthub.io/packages/search?org=kcl&sort=relevance&page=1). +Check out this [blog](https://blog.crossplane.io/function-kcl/) to learn more. + ## Developing ```shell @@ -24,7 +26,7 @@ $ docker build . --tag=kcllang/crossplane-kcl $ crossplane xpkg build -f package --embed-runtime-image=kcllang/crossplane-kcl # Push a function package to the registry -$ crossplane --verbose xpkg push -f package/*.xpkg docker.io/kcllang/crossplane-kcl +$ crossplane --verbose xpkg push -f package/*.xpkg xpkg.upbound.io/crossplane-contrib/function-kcl:v0.2.0 ``` ## Quick Start Examples and Debug Locally @@ -40,7 +42,7 @@ kind: Function metadata: name: kcl-function spec: - package: docker.io/kcllang/crossplane-kcl + package: xpkg.upbound.io/crossplane-contrib/function-kcl:v0.2.0 EOF ``` @@ -68,7 +70,6 @@ Here's what you can do in the KCL script: + Read the `ObservedComposedResources` from `option("params").ocds`. + Read the `DesiredCompositeResource` from `option("params").dxr`. + Read the `DesiredComposedResources` from `option("params").dcds`. -+ Read the environment variables. e.g. `option("PATH")` (**Not yet implemented**). ## Library diff --git a/examples/patch_desired/patching/functions.yaml b/examples/patch_desired/patching/functions.yaml index b987b56..9a56862 100644 --- a/examples/patch_desired/patching/functions.yaml +++ b/examples/patch_desired/patching/functions.yaml @@ -6,4 +6,4 @@ metadata: # This tells crossplane beta render to connect to the function locally. render.crossplane.io/runtime: Development spec: - package: docker.io/kcllang/crossplane-kcl + package: xpkg.upbound.io/crossplane-contrib/function-kcl:v0.2.0 diff --git a/examples/patch_resources/patching/functions.yaml b/examples/patch_resources/patching/functions.yaml index b987b56..9a56862 100644 --- a/examples/patch_resources/patching/functions.yaml +++ b/examples/patch_resources/patching/functions.yaml @@ -6,4 +6,4 @@ metadata: # This tells crossplane beta render to connect to the function locally. render.crossplane.io/runtime: Development spec: - package: docker.io/kcllang/crossplane-kcl + package: xpkg.upbound.io/crossplane-contrib/function-kcl:v0.2.0 diff --git a/examples/patch_resources/patching_multiple/functions.yaml b/examples/patch_resources/patching_multiple/functions.yaml index b987b56..9a56862 100644 --- a/examples/patch_resources/patching_multiple/functions.yaml +++ b/examples/patch_resources/patching_multiple/functions.yaml @@ -6,4 +6,4 @@ metadata: # This tells crossplane beta render to connect to the function locally. render.crossplane.io/runtime: Development spec: - package: docker.io/kcllang/crossplane-kcl + package: xpkg.upbound.io/crossplane-contrib/function-kcl:v0.2.0 diff --git a/examples/resources/basic/functions.yaml b/examples/resources/basic/functions.yaml index b987b56..9a56862 100644 --- a/examples/resources/basic/functions.yaml +++ b/examples/resources/basic/functions.yaml @@ -6,4 +6,4 @@ metadata: # This tells crossplane beta render to connect to the function locally. render.crossplane.io/runtime: Development spec: - package: docker.io/kcllang/crossplane-kcl + package: xpkg.upbound.io/crossplane-contrib/function-kcl:v0.2.0 diff --git a/examples/resources/condition/functions.yaml b/examples/resources/condition/functions.yaml index b987b56..9a56862 100644 --- a/examples/resources/condition/functions.yaml +++ b/examples/resources/condition/functions.yaml @@ -6,4 +6,4 @@ metadata: # This tells crossplane beta render to connect to the function locally. render.crossplane.io/runtime: Development spec: - package: docker.io/kcllang/crossplane-kcl + package: xpkg.upbound.io/crossplane-contrib/function-kcl:v0.2.0 diff --git a/examples/resources/format/functions.yaml b/examples/resources/format/functions.yaml index b987b56..9a56862 100644 --- a/examples/resources/format/functions.yaml +++ b/examples/resources/format/functions.yaml @@ -6,4 +6,4 @@ metadata: # This tells crossplane beta render to connect to the function locally. render.crossplane.io/runtime: Development spec: - package: docker.io/kcllang/crossplane-kcl + package: xpkg.upbound.io/crossplane-contrib/function-kcl:v0.2.0 diff --git a/examples/resources/loop/functions.yaml b/examples/resources/loop/functions.yaml index b987b56..9a56862 100644 --- a/examples/resources/loop/functions.yaml +++ b/examples/resources/loop/functions.yaml @@ -6,4 +6,4 @@ metadata: # This tells crossplane beta render to connect to the function locally. render.crossplane.io/runtime: Development spec: - package: docker.io/kcllang/crossplane-kcl + package: xpkg.upbound.io/crossplane-contrib/function-kcl:v0.2.0 diff --git a/examples/resources/network/functions.yaml b/examples/resources/network/functions.yaml index b987b56..9a56862 100644 --- a/examples/resources/network/functions.yaml +++ b/examples/resources/network/functions.yaml @@ -6,4 +6,4 @@ metadata: # This tells crossplane beta render to connect to the function locally. render.crossplane.io/runtime: Development spec: - package: docker.io/kcllang/crossplane-kcl + package: xpkg.upbound.io/crossplane-contrib/function-kcl:v0.2.0 diff --git a/examples/resources/options/functions.yaml b/examples/resources/options/functions.yaml index b987b56..9a56862 100644 --- a/examples/resources/options/functions.yaml +++ b/examples/resources/options/functions.yaml @@ -6,4 +6,4 @@ metadata: # This tells crossplane beta render to connect to the function locally. render.crossplane.io/runtime: Development spec: - package: docker.io/kcllang/crossplane-kcl + package: xpkg.upbound.io/crossplane-contrib/function-kcl:v0.2.0 diff --git a/examples/resources/options_oxr/functions.yaml b/examples/resources/options_oxr/functions.yaml index b987b56..9a56862 100644 --- a/examples/resources/options_oxr/functions.yaml +++ b/examples/resources/options_oxr/functions.yaml @@ -6,4 +6,4 @@ metadata: # This tells crossplane beta render to connect to the function locally. render.crossplane.io/runtime: Development spec: - package: docker.io/kcllang/crossplane-kcl + package: xpkg.upbound.io/crossplane-contrib/function-kcl:v0.2.0 diff --git a/examples/resources/regex/functions.yaml b/examples/resources/regex/functions.yaml index b987b56..9a56862 100644 --- a/examples/resources/regex/functions.yaml +++ b/examples/resources/regex/functions.yaml @@ -6,4 +6,4 @@ metadata: # This tells crossplane beta render to connect to the function locally. render.crossplane.io/runtime: Development spec: - package: docker.io/kcllang/crossplane-kcl + package: xpkg.upbound.io/crossplane-contrib/function-kcl:v0.2.0 diff --git a/examples/xr/patching/functions.yaml b/examples/xr/patching/functions.yaml index b987b56..9a56862 100644 --- a/examples/xr/patching/functions.yaml +++ b/examples/xr/patching/functions.yaml @@ -6,4 +6,4 @@ metadata: # This tells crossplane beta render to connect to the function locally. render.crossplane.io/runtime: Development spec: - package: docker.io/kcllang/crossplane-kcl + package: xpkg.upbound.io/crossplane-contrib/function-kcl:v0.2.0 diff --git a/manifests/kcl-functions.yaml b/manifests/kcl-functions.yaml index e043a9f..b79af01 100644 --- a/manifests/kcl-functions.yaml +++ b/manifests/kcl-functions.yaml @@ -3,4 +3,4 @@ kind: Function metadata: name: kcl-function spec: - package: docker.io/kcllang/crossplane-kcl + package: xpkg.upbound.io/crossplane-contrib/function-kcl:v0.2.0