Skip to content
This repository was archived by the owner on May 5, 2025. It is now read-only.

Commit 8dd6f44

Browse files
jmcxsameersbn
authored andcommitted
Minor updates and fixes to functions docs (#385)
1 parent 3608c75 commit 8dd6f44

File tree

4 files changed

+23
-2
lines changed

4 files changed

+23
-2
lines changed

docs/transformation/functions/index.md

+14
Original file line numberDiff line numberDiff line change
@@ -8,3 +8,17 @@ For low-code style transformations in JSON, refer to [JSON Transformation](../js
88
TriggerMesh functions with `tmctl` is a work in progress and not currently supported.
99

1010
Furthermore, note that TriggerMesh Functions are opinionated and simple. They are aimed to be used for event transformation and do not support external dependencies. Functions that may need external dependencies are best served with something like AWS Lambda or [Knative Functions](https://knative.dev/docs/functions/).
11+
12+
See the [Kubernetes object reference](../../reference/extensions/#extensions.triggermesh.io/v1alpha1.Function) for the Function reference docs.
13+
14+
## Common function configuration options
15+
16+
Below are some parameters you can configure in the function CRD, that apply to all function runtimes.
17+
18+
| Parameter | Description |
19+
| ------------------------- | ------------------------------------------------------------ |
20+
| `adapterOverrides.public` | Boolean. If true, function will be allocated a public URL so that it can be accessed from outside the cluster. Default is false. |
21+
| `ceOverrides.extensions` | Can be used to modify the values of CloudEvents attributes in the event return by the function back to the caller. |
22+
| `responseIsEvent` | Boolean. If false, the function will wrap what is returned by the function into the `data` attribute of a CloudEvent and respond back to the caller with it. It will add default CloudEvent metadata attributes, unless values are overriden in `ceOverrides`. If true, expects the user to have returned a complete CloudEvent object, and will no wrap it into the `data` attribute of a new CloudEvent. |
23+
| `entrypoint` | Name of the function to be used as an entry point in the code. |
24+
| `runtime` | Currently supported runtime values are `python`, `node`, and `ruby`. |

docs/transformation/functions/nodejsfunctions.md

+2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
# NodeJS functions
22

3+
For information about configuration options across all function runtimes, please head to the [main functions documentation page](index.md).
4+
35
## NodeJS empty field transformation example on Kubernetes
46

57
```yaml

docs/transformation/functions/pythonfunctions.md

+5-2
Original file line numberDiff line numberDiff line change
@@ -25,11 +25,14 @@ metadata:
2525
name: python-function-hello
2626
spec:
2727
runtime: python
28-
public: true
28+
adapterOverrides:
29+
public: true
2930
entrypoint: endpoint
3031
code: |
32+
import json
3133
def endpoint(event, context):
32-
return "Hello " + event['name']
34+
jsonEvent = json.loads(event)
35+
return "Hello " + jsonEvent['name']
3336
```
3437
3538
You can then create the function with:

docs/transformation/functions/rubyfunctions.md

+2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
# Ruby functions
22

3+
For information about configuration options across all function runtimes, please head to the [main functions documentation page](index.md).
4+
35
## Ruby date and time event example on Kubernetes
46

57
```YAML

0 commit comments

Comments
 (0)