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

docs: deno rather than function for deno-runtime runner #1611

Merged
merged 1 commit into from
Jun 22, 2023
Merged
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
43 changes: 25 additions & 18 deletions docs/content/en/docs/yaml-crd-ref/taskdefinition.md
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ kind: KeptnTaskDefinition
metadata:
name: <task-name>
spec:
function | python | container
deno | python | container
...
retries: <integer>
timeout: <duration-in-seconds>
Expand All @@ -88,11 +88,11 @@ but timeouts seem to be measured in seconds.
[Kubernetes Object Names and IDs](https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#dns-subdomain-names)
specification.
* **spec**
* **function | python | container** -- Define the container type
* **deno | python | container** -- Define the container type
to use for this task.
Each task can use one type of runner,
identified by this field:
* **function** -- Use a `deno-runtime` runner
* **deno** -- Use a `deno-runtime` runner
and code the functionality in Deno script,
which is similar to JavaScript and Typescript.
See
Expand All @@ -119,7 +119,7 @@ but timeouts seem to be measured in seconds.
## Yaml Synopsis for deno-runtime container

When using the `deno-runtime` runner to define a task,
the `function` is coded in Deno-script
the task is coded in Deno-script
(which is mostly the same as JavaScript and TypeScript)
and executed in the
[Deno](https://deno.com/runtime) runner,
Expand All @@ -136,7 +136,7 @@ kind: KeptnTaskDefinition
metadata:
name: <task-name>
spec:
function:
deno:
inline | httpRef | functionRef | ConfigMapRef
parameters:
map:
Expand All @@ -148,20 +148,20 @@ spec:
### Spec fields for deno-runtime definitions

* **spec**
* **function** -- Code to be executed,
expressed as a [Deno](https://deno.land/) script.
* **deno** -- Specify that the task uses the `deno-runtime`
and is expressed as a [Deno](https://deno.land/) script.
Refer to [function runtime](https://github.com/keptn/lifecycle-toolkit/tree/main/functions-runtime)
for more information about this runner.

The `function` can be defined as one of the following:
The task can be defined as one of the following:

* **inline** - Include the actual executable code to execute.
This can be written as a full-fledged Deno script
that is included in this file.
For example:

```yaml
function:
deno:
inline:
code: |
console.log("Deployment Task has been executed");
Expand All @@ -174,7 +174,7 @@ spec:
```yaml
name: hello-keptn-http
spec:
function:
deno:
httpRef:
url: "https://www.example.com/yourscript.js"
```
Expand All @@ -189,7 +189,7 @@ spec:

```yaml
spec:
function:
deno:
functionRef:
name: slack-notification
```
Expand Down Expand Up @@ -276,8 +276,8 @@ almost anything that you implemented with JES for Keptn v1.

## Yaml Synopsis for Python-runtime runner

The `python-runtime` runner is built on the `container-runtime` runner
to provide a way easily define a task using Python 3.
The `python-runtime` runner provides a way
to easily define a task using Python 3.
You do not need to specify the image, volumes, and so forth.
Instead, just provide a Python script
and KLT sets up the container and runs the script as part of the task.
Expand Down Expand Up @@ -432,7 +432,7 @@ kind: KeptnTaskDefinition
metadata:
name: hello-keptn-inline
spec:
function:
deno:
inline:
code: |
let text = Deno.env.get("DATA");
Expand All @@ -454,7 +454,7 @@ kind: KeptnTaskDefinition
metadata:
name: hello-keptn-http
spec:
function:
deno:
httpRef:
url: "https://www.example.com/yourscript.js"
```
Expand All @@ -480,7 +480,7 @@ kind: KeptnTaskDefinition
metadata:
name: slack-notification-dev
spec:
function:
deno:
functionRef:
name: slack-notification
parameters:
Expand All @@ -501,7 +501,7 @@ kind: KeptnTaskDefinition
metadata:
name: keptntaskdefinition-sample
spec:
function:
deno:
configMapRef:
name: dev-configmap
```
Expand Down Expand Up @@ -636,9 +636,16 @@ API Reference:

The `KeptnTaskDefinition` support for
the `container-runtime` and `python-runtime` is introduced in v0.8.0.
This modifies the synopsis in two ways:
This modifies the synopsis in the following ways:

* Add the `spec.container` field.
* Add the `python` descriptor for the `python-runtime` runner.
* Add the `container` descriptor for the `container-runtime` runner.
* Add the `deno` descriptor to replace `function`
for the `deno-runtime` runner.
The `function` identifier for the `deno-runtime` runner
is deprecated;
it still works for v 0.8.0 but will be dropped from future releases.
* The `spec.function` field is changed to be a pointer receiver.
This aligns it with the `spec.container` field,
which must be a pointer,
Expand Down