Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add https example using git references without pkl package releases #34

Merged
merged 3 commits into from
Jul 18, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,10 @@ spec:

### Example
see [examples](./example/)
and see [pkl/crossplane.contrib.example/DEPLOY.md](pkl/crossplane.contrib.example/DEPLOY.md) on instructions how to deploy it.
and see [pkl/crossplane.contrib.example/DEPLOY.md](pkl/crossplane.contrib.example/DEPLOY.md) on instructions how to deploy using Pkl Packages.

Alternatively [example/git/README.md](example/git/README.md) shows an appraoch without releasing Packages.

## Creating a new Composition Function
see [pkl/crossplane.contrib.example/DEVELOP.md](pkl/crossplane.contrib.example/DEVELOP.md)

Expand Down
2 changes: 1 addition & 1 deletion example/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,5 +10,5 @@ $ go run . --insecure --debug

```shell
# Then, in another terminal, call it with these example manifests
$ crossplane beta render xr.yaml composition.yaml functions.yaml --observed-resources=observed.yaml
$ crossplane beta render xr.yaml composition.yaml functions.yaml
```
9 changes: 0 additions & 9 deletions example/full/observed.yaml

This file was deleted.

14 changes: 14 additions & 0 deletions example/git/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
# Using Raw Git References
Instead of releasing a Pkl Package this approach reads directly from a git repository.

Currently this method does ot support PklProject dependencies, meaning all dependencies must be declared explicitely.

```pkl
// e.g.
amends "package://pkg.pkl-lang.org/github.com/crossplane-contrib/function-pkl/[email protected]#/CompositionResponse.pkl"

// instead of
amends "@crossplane.contrib/CompositionResponse.pkl"
```

For more information about Generating the Pkl Modules, XRDs, and Compositions see [DEVELOP.md](../../pkl/crossplane.contrib.example/DEVELOP.md)
19 changes: 19 additions & 0 deletions example/git/composition.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
apiVersion: apiextensions.crossplane.io/v1
kind: Composition
metadata:
name: pkl-git-example
spec:
compositeTypeRef:
apiVersion: example.crossplane.io/v1
kind: XR
mode: Pipeline
pipeline:
- functionRef:
name: function-pkl
input:
apiVersion: pkl.fn.crossplane.io/v1beta1
kind: Pkl
spec:
type: uri
uri: https://raw.githubusercontent.com/crossplane-contrib/function-pkl/main/example/git/pkl/step.pkl
step: pkl-template
5 changes: 5 additions & 0 deletions example/git/extraresources.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
apiVersion: kubernetes.crossplane.io/v1alpha2
kind: Object
metadata:
name: required
11 changes: 11 additions & 0 deletions example/git/functions.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
---
apiVersion: pkg.crossplane.io/v1beta1
kind: Function
metadata:
name: function-pkl
annotations:
# This tells crossplane beta render to connect to the function locally.
render.crossplane.io/runtime: Development
spec:
# This is ignored when using the Development runtime.
package: function-pkl
Loading