Skip to content

Commit

Permalink
fix: remove space
Browse files Browse the repository at this point in the history
Signed-off-by: realanna <anna.reale@dynatrace.com>
  • Loading branch information
RealAnna committed Jun 13, 2023
1 parent aad1dbf commit a5aa040
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions docs/content/en/docs/implementing/tasks/python.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ Keptn tasks are defined in a
[KeptnTaskDefinition](../../yaml-crd-ref/taskdefinition.md/)
resource.
A task definition can use a python runtime to specify a task that runs python3 code.
The python code can be specified as:
The python code can be specified as:

- inline
- an HTTP reference to a script
Expand All @@ -18,6 +18,7 @@ The python code can be specified as:
resource that is populated with the code to execute

## Inline

You can embed python code directly in the taskDefinition.
Consider the following example, where we print data stored in the parameters map:
{{< readfile file="/yaml/python_execution/taskdefinition_pyfunction_inline.yaml" code="true" lang="yaml" >}}
Expand All @@ -28,7 +29,9 @@ Consider the following:
{{< readfile file="/yaml/python_ execution/taskdefinition_pyfunction_configmap.yaml" code="true" lang="yaml" >}}

## Refer to another TaskDefinition
You can refer to an existing taskDefinition. Consider the following example, this will call the inline example but will override the data printed with what is specified in the task:

You can refer to an existing taskDefinition.
Consider the following example, this will call the inline example but will override the data printed with what is specified in the task:
{{< readfile file="/yaml/python_ execution/taskdefinition_pyfunction_recursive.yaml" code="true" lang="yaml" >}}

## Config Map
Expand All @@ -37,10 +40,12 @@ Consider the following example:
{{< readfile file="/yaml/python_ execution/taskdefinition_pyfunction_configmap.yaml" code="true" lang="yaml" >}}

## Allowed libraries for the Python runtime

The following example shows how to use few of the allowed packages, namely: requests, json, git, yaml
{{< readfile file="/yaml/python_ execution/taskdefinition_pyfunction_inline_printargs_py.yaml" code="true" lang="yaml" >}}

## Passing secrets, env vars and modifying the python command

In the following examples you can see how to pass data inside the parameter map, how to load a secret in your code and finally how to modify the python command.
In this case the container will run with the option -h which will print the help of the python3 command.

Expand Down

0 comments on commit a5aa040

Please sign in to comment.