generated from crossplane/function-template-go
-
Notifications
You must be signed in to change notification settings - Fork 18
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #155 from crossplane-contrib/chore-bump-kcl-deps-0…
….10.x chore: bump kcl version to 0.10.x and add dependency examples
- Loading branch information
Showing
78 changed files
with
314 additions
and
153 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -6,7 +6,7 @@ on: | |
branches: [ main ] | ||
|
||
env: | ||
GO_VERSION: '1.22' | ||
GO_VERSION: '1.23' | ||
|
||
jobs: | ||
test: | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
run: | ||
crossplane render xr.yaml composition.yaml functions.yaml -r |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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" | ||
} | ||
} | ||
] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.