Skip to content

Commit

Permalink
update for marketplace release
Browse files Browse the repository at this point in the history
Signed-off-by: Steven Borrelli <[email protected]>
  • Loading branch information
stevendborrelli committed May 28, 2024
1 parent 0c44834 commit 97306df
Show file tree
Hide file tree
Showing 6 changed files with 49 additions and 21 deletions.
16 changes: 7 additions & 9 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,9 @@ Functions require Crossplane 1.14 or newer. Apply the following manifest to your
apiVersion: pkg.crossplane.io/v1beta1
kind: Function
metadata:
name: function-unit-test
name: crossplane-contrib-function-unit-test
spec:
package: index.docker.io/steve/function-unit-test:v0.1.0
package: xpkg.upbound.io/crossplane-contrib/function-unit-test:v0.1.0
```
## Configuring Unit Tests
Expand All @@ -31,7 +31,7 @@ useful when running this function in CI pipelines via `crossplane beta render`.
```yaml
- step:
functionRef:
name: function-unit-test
name: crossplane-contrib-function-unit-test
input:
apiVersion: unittest.fn.crossplane.io/v1beta1
kind: TestCases
Expand Down Expand Up @@ -70,9 +70,7 @@ $ docker build . --tag=function-unit-test-runtime
$ crossplane xpkg build -f package --embed-runtime-image=function-unit-test-runtime
```

[functions]: https://docs.crossplane.io/latest/concepts/composition-functions
[go]: https://go.dev
[function guide]: https://docs.crossplane.io/knowledge-base/guides/write-a-composition-function-in-go
[package docs]: https://pkg.go.dev/github.com/crossplane/function-sdk-go
[docker]: https://www.docker.com
[cli]: https://docs.crossplane.io/latest/cli
## Reference Links

- functions: <https://docs.crossplane.io/latest/concepts/composition-functions>
- function guide <https://docs.crossplane.io/knowledge-base/guides/write-a-composition-function-in-go>
8 changes: 4 additions & 4 deletions examples/basic-tests/composition.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,9 @@ spec:
kind: XNopResource
mode: Pipeline
pipeline:
- step: conditional-patch-and-transform
- step: patch-and-transform
functionRef:
name: function-patch-and-transform
name: crossplane-contrib-function-patch-and-transform
input:
apiVersion: pt.fn.crossplane.io/v1beta1
kind: Resources
Expand Down Expand Up @@ -70,9 +70,9 @@ spec:
value: verysecurepassword
- name: endpoint
value: 127.0.0.1
- step:
- step: unit-test
functionRef:
name: function-unit-test
name: crossplane-contrib-function-unit-test
input:
apiVersion: unittest.fn.crossplane.io/v1beta1
kind: TestCases
Expand Down
24 changes: 24 additions & 0 deletions examples/basic-tests/definition.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
apiVersion: apiextensions.crossplane.io/v1
kind: CompositeResourceDefinition
metadata:
name: xnopresources.nop.example.org
spec:
group: nop.example.org
names:
kind: XNopResource
plural: xnopresources
versions:
- name: v1alpha1
referenceable: true
served: true
schema:
openAPIV3Schema:
type: object
properties:
spec:
type: object
properties:
env:
type: string
render:
type: boolean
15 changes: 7 additions & 8 deletions examples/basic-tests/function.yaml
Original file line number Diff line number Diff line change
@@ -1,18 +1,17 @@
apiVersion: pkg.crossplane.io/v1beta1
kind: Function
metadata:
name: function-patch-and-transform
name: crossplane-contrib-function-patch-and-transform
spec:
package: xpkg.upbound.io/crossplane-contrib/function-patch-and-transform:v0.2.0
packagePullPolicy: Always
package: xpkg.upbound.io/crossplane-contrib/function-patch-and-transform:v0.5.0
---
apiVersion: pkg.crossplane.io/v1beta1
kind: Function
metadata:
name: function-unit-test
annotations:
render.crossplane.io/runtime: Development
name: crossplane-contrib-function-unit-test
# Uncomment for local go development of function
# annotations:
# render.crossplane.io/runtime: Development
spec:
package: index.docker.io/steve/function-unit-test:v0.1.0
packagePullPolicy: Always
package: xpkg.upbound.io/crossplane-contrib/function-unit-test:v0.1.0

6 changes: 6 additions & 0 deletions examples/basic-tests/provider.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
apiVersion: pkg.crossplane.io/v1
kind: Provider
metadata:
name: crossplane-contrib-provider-nop
spec:
package: xpkg.upbound.io/crossplane-contrib/provider-nop:v0.2.0
1 change: 1 addition & 0 deletions examples/basic-tests/render.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
crossplane beta render -r xr.yaml composition.yaml function.yaml

0 comments on commit 97306df

Please sign in to comment.