Skip to content

Commit

Permalink
Merge pull request #155 from crossplane-contrib/chore-bump-kcl-deps-0…
Browse files Browse the repository at this point in the history
….10.x

chore: bump kcl version to 0.10.x and add dependency examples
  • Loading branch information
Peefy authored Sep 18, 2024
2 parents 46d656d + d809bcb commit e5b5d87
Show file tree
Hide file tree
Showing 78 changed files with 314 additions and 153 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ on:

env:
# Common versions
GO_VERSION: '1.22'
GO_VERSION: '1.23'
GOLANGCI_VERSION: 'v1.54.2'
DOCKER_BUILDX_VERSION: 'v0.11.2'

Expand All @@ -35,7 +35,7 @@ env:
XPKG: xpkg.upbound.io/${{ github.repository}}

# The package version to push. The default is 0.0.0-gitsha.
XPKG_VERSION: v0.9.4
XPKG_VERSION: v0.10.0

jobs:
lint:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/e2e.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ on:
branches: [ main ]

env:
GO_VERSION: '1.22'
GO_VERSION: '1.23'

jobs:
test:
Expand Down
2 changes: 1 addition & 1 deletion examples/default/connection_details/Makefile
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
run:
crossplane beta render xr.yaml composition.yaml functions.yaml -r
crossplane render xr.yaml composition.yaml functions.yaml -r
4 changes: 2 additions & 2 deletions examples/default/connection_details/README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Example Manifests

You can run your function locally and test it using `crossplane beta render`
You can run your function locally and test it using `crossplane render`
with these example manifests.

```shell
Expand All @@ -10,7 +10,7 @@ $ go run . --insecure --debug

```shell
# Then, in another terminal, call it with these example manifests
$ crossplane beta render xr.yaml composition.yaml functions.yaml -r
$ crossplane render xr.yaml composition.yaml functions.yaml -r
---
apiVersion: example.crossplane.io/v1beta1
kind: XR
Expand Down
2 changes: 1 addition & 1 deletion examples/default/connection_details/functions.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ kind: Function
metadata:
name: kcl-function
annotations:
# This tells crossplane beta render to connect to the function locally.
# This tells crossplane render to connect to the function locally.
render.crossplane.io/runtime: Development
spec:
package: xpkg.upbound.io/crossplane-contrib/function-kcl:latest
2 changes: 2 additions & 0 deletions examples/default/dependencies/Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
run:
crossplane render xr.yaml composition.yaml functions.yaml -r
85 changes: 85 additions & 0 deletions examples/default/dependencies/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,85 @@
# Example Manifests

You can run your function locally and test it using `crossplane render`
with these example manifests.

```shell
# Run the function locally
$ go run . --insecure --debug
```

```shell
# Then, in another terminal, call it with these example manifests
$ crossplane render xr.yaml composition.yaml functions.yaml -r
---
apiVersion: example.crossplane.io/v1beta1
kind: XR
metadata:
name: example
---
apiVersion: pkg.crossplane.io/v1beta1
kind: DeploymentRuntimeConfig
metadata:
annotations:
crossplane.io/composition-resource-name: provider-helm
generateName: example-
labels:
crossplane.io/composite: example
name: provider-helm
ownerReferences:
- apiVersion: example.crossplane.io/v1beta1
blockOwnerDeletion: true
controller: true
kind: XR
name: example
uid: ""
spec:
serviceAccountTemplate:
metadata:
name: provider-helm
---
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRoleBinding
metadata:
annotations:
crossplane.io/composition-resource-name: provider-helm-cluster-admin
generateName: example-
labels:
crossplane.io/composite: example
name: provider-helm-cluster-admin
ownerReferences:
- apiVersion: example.crossplane.io/v1beta1
blockOwnerDeletion: true
controller: true
kind: XR
name: example
uid: ""
roleRef:
apiGroup: rbac.authorization.k8s.io
kind: ClusterRole
name: provider-helm-cluster-admin
subjects:
- kind: ServiceAccount
name: provider-helm
namespace: crossplane-system
---
apiVersion: helm.crossplane.io/v1beta1
kind: ProviderConfig
metadata:
annotations:
crossplane.io/composition-resource-name: helm-provider
generateName: example-
labels:
crossplane.io/composite: example
name: helm-provider
ownerReferences:
- apiVersion: example.crossplane.io/v1beta1
blockOwnerDeletion: true
controller: true
kind: XR
name: example
uid: ""
spec:
credentials:
source: InjectedIdentity
```
61 changes: 61 additions & 0 deletions examples/default/dependencies/composition.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
apiVersion: apiextensions.crossplane.io/v1
kind: Composition
metadata:
name: function-template-go
spec:
compositeTypeRef:
apiVersion: example.crossplane.io/v1
kind: XR
mode: Pipeline
pipeline:
- step: normal
functionRef:
name: kcl-function
input:
apiVersion: krm.kcl.dev/v1alpha1
kind: KCLInput
metadata:
name: basic
spec:
dependencies: |
k8s = "1.31"
crossplane = "1.16.0"
source: |
import k8s.api.rbac.v1 as k8srbac
import crossplane.v1 as cpv1
import crossplane.v1beta1 as cpv1beta1
items = [
cpv1.Provider {
metadata.name = "provider-helm"
spec: {
package = "xpkg.upbound.io/crossplane-contrib/provider-helm:v0.19.0"
runtimeConfigRef.name = "provider-helm"
}
}
cpv1beta1.DeploymentRuntimeConfig {
metadata.name = "provider-helm"
spec: {
serviceAccountTemplate: {metadata.name = "provider-helm"}
}
}
k8srbac.ClusterRoleBinding {
metadata.name = "provider-helm-cluster-admin"
subjects: [{
kind = "ServiceAccount"
name = "provider-helm"
namespace = "crossplane-system"
}]
roleRef: {
kind = "ClusterRole"
name = "provider-helm-cluster-admin"
apiGroup = "rbac.authorization.k8s.io"
}
}
cpv1beta1.ProviderConfig {
metadata.name = "helm-provider"
spec = {
credentials.source = "InjectedIdentity"
}
}
]
9 changes: 9 additions & 0 deletions examples/default/dependencies/functions.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
apiVersion: pkg.crossplane.io/v1beta1
kind: Function
metadata:
name: kcl-function
annotations:
# This tells crossplane render to connect to the function locally.
render.crossplane.io/runtime: Development
spec:
package: xpkg.upbound.io/crossplane-contrib/function-kcl:latest
6 changes: 6 additions & 0 deletions examples/default/dependencies/xr.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
apiVersion: example.crossplane.io/v1beta1
kind: XR
metadata:
name: example
spec:
count: 1
2 changes: 1 addition & 1 deletion examples/default/external_deps/Makefile
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
run:
crossplane beta render xr.yaml composition.yaml functions.yaml -r
crossplane render xr.yaml composition.yaml functions.yaml -r
4 changes: 2 additions & 2 deletions examples/default/external_deps/README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Example Manifests

You can run your function locally and test it using `crossplane beta render`
You can run your function locally and test it using `crossplane render`
with these example manifests.

```shell
Expand All @@ -10,7 +10,7 @@ $ go run . --insecure --debug

```shell
# Then, in another terminal, call it with these example manifests
$ crossplane beta render xr.yaml composition.yaml functions.yaml -r
$ crossplane render xr.yaml composition.yaml functions.yaml -r
---
apiVersion: example.crossplane.io/v1beta1
kind: XR
Expand Down
2 changes: 1 addition & 1 deletion examples/default/external_deps/functions.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ kind: Function
metadata:
name: kcl-function
annotations:
# This tells crossplane beta render to connect to the function locally.
# This tells crossplane render to connect to the function locally.
render.crossplane.io/runtime: Development
spec:
package: xpkg.upbound.io/crossplane-contrib/function-kcl:latest
2 changes: 1 addition & 1 deletion examples/default/function_ctx/Makefile
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
run:
crossplane beta render xr.yaml composition.yaml functions.yaml -r
crossplane render xr.yaml composition.yaml functions.yaml -r
4 changes: 2 additions & 2 deletions examples/default/function_ctx/README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Example Manifests

You can run your function locally and test it using `crossplane beta render`
You can run your function locally and test it using `crossplane render`
with these example manifests.

```shell
Expand All @@ -10,7 +10,7 @@ $ go run . --insecure --debug

```shell
# Then, in another terminal, call it with these example manifests
$ crossplane beta render xr.yaml composition.yaml functions.yaml -r
$ crossplane render xr.yaml composition.yaml functions.yaml -r
---
apiVersion: example.crossplane.io/v1beta1
kind: XR
Expand Down
2 changes: 1 addition & 1 deletion examples/default/function_ctx/functions.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ kind: Function
metadata:
name: kcl-function
annotations:
# This tells crossplane beta render to connect to the function locally.
# This tells crossplane render to connect to the function locally.
render.crossplane.io/runtime: Development
spec:
package: xpkg.upbound.io/crossplane-contrib/function-kcl:latest
2 changes: 1 addition & 1 deletion examples/default/read_ocds_resource/Makefile
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
render:
crossplane beta render xr.yaml composition.yaml functions.yaml \
crossplane render xr.yaml composition.yaml functions.yaml \
--observed-resources=existing-observed-resources.yaml
4 changes: 2 additions & 2 deletions examples/default/read_ocds_resource/README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Example Manifests

You can run your function locally and test it using `crossplane beta render`
You can run your function locally and test it using `crossplane render`
with these example manifests.

```shell
Expand All @@ -10,7 +10,7 @@ $ go run . --insecure --debug

```shell
# Then, in another terminal, call it with these example manifests
$ crossplane beta render xr.yaml composition.yaml functions.yaml \
$ crossplane render xr.yaml composition.yaml functions.yaml \
--observed-resources=existing-observed-resources.yaml
---
apiVersion: example.crossplane.io/v1beta1
Expand Down
2 changes: 1 addition & 1 deletion examples/default/read_ocds_resource/functions.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ kind: Function
metadata:
name: kcl-function
annotations:
# This tells crossplane beta render to connect to the function locally.
# This tells crossplane render to connect to the function locally.
render.crossplane.io/runtime: Development
spec:
package: xpkg.upbound.io/crossplane-contrib/function-kcl:latest
2 changes: 1 addition & 1 deletion examples/default/resources/Makefile
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
run:
crossplane beta render xr.yaml composition.yaml functions.yaml -r
crossplane render xr.yaml composition.yaml functions.yaml -r
4 changes: 2 additions & 2 deletions examples/default/resources/README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Example Manifests

You can run your function locally and test it using `crossplane beta render`
You can run your function locally and test it using `crossplane render`
with these example manifests.

```shell
Expand All @@ -10,7 +10,7 @@ $ go run . --insecure --debug

```shell
# Then, in another terminal, call it with these example manifests
$ crossplane beta render xr.yaml composition.yaml functions.yaml -r
$ crossplane render xr.yaml composition.yaml functions.yaml -r
---
apiVersion: example.crossplane.io/v1beta1
kind: XR
Expand Down
2 changes: 1 addition & 1 deletion examples/default/resources/functions.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ kind: Function
metadata:
name: kcl-function
annotations:
# This tells crossplane beta render to connect to the function locally.
# This tells crossplane render to connect to the function locally.
render.crossplane.io/runtime: Development
spec:
package: xpkg.upbound.io/crossplane-contrib/function-kcl:latest
2 changes: 1 addition & 1 deletion examples/default/resources_without_xr/Makefile
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
run:
crossplane beta render xr.yaml composition.yaml functions.yaml -r
crossplane render xr.yaml composition.yaml functions.yaml -r
4 changes: 2 additions & 2 deletions examples/default/resources_without_xr/README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Example Manifests

You can run your function locally and test it using `crossplane beta render`
You can run your function locally and test it using `crossplane render`
with these example manifests.

```shell
Expand All @@ -10,7 +10,7 @@ $ go run . --insecure --debug

```shell
# Then, in another terminal, call it with these example manifests
$ crossplane beta render xr.yaml composition.yaml functions.yaml -r
$ crossplane render xr.yaml composition.yaml functions.yaml -r
---
apiVersion: example.crossplane.io/v1beta1
kind: XR
Expand Down
2 changes: 1 addition & 1 deletion examples/default/resources_without_xr/functions.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ kind: Function
metadata:
name: kcl-function
annotations:
# This tells crossplane beta render to connect to the function locally.
# This tells crossplane render to connect to the function locally.
render.crossplane.io/runtime: Development
spec:
package: xpkg.upbound.io/crossplane-contrib/function-kcl:latest
2 changes: 1 addition & 1 deletion examples/patch_desired/patching/Makefile
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
run:
crossplane beta render xr.yaml composition.yaml functions.yaml -r
crossplane render xr.yaml composition.yaml functions.yaml -r
4 changes: 2 additions & 2 deletions examples/patch_desired/patching/README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Example Manifests

You can run your function locally and test it using `crossplane beta render`
You can run your function locally and test it using `crossplane render`
with these example manifests.

```shell
Expand All @@ -10,7 +10,7 @@ $ go run . --insecure --debug

```shell
# Then, in another terminal, call it with these example manifests
$ crossplane beta render xr.yaml composition.yaml functions.yaml -r
$ crossplane render xr.yaml composition.yaml functions.yaml -r
---
apiVersion: nopexample.org/v1
kind: XSubnetwork
Expand Down
Loading

0 comments on commit e5b5d87

Please sign in to comment.