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

Document behaviour of script field when "$$" and "$(X)" are used #3939

Closed
wants to merge 1 commit into from
Closed
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
12 changes: 12 additions & 0 deletions docs/tasks.md
Original file line number Diff line number Diff line change
Expand Up @@ -261,6 +261,18 @@ steps:
#!/usr/bin/env bash
/bin/my-binary
```

**Note:** Kubernetes processes the contents of the `script` field using rules applied to
`args` fields of containers. This can result in some unexpected behaviour:
1. Instances of two dollar signs can be replaced in your scripts with a single dollar sign.
In other words, "$$" is replaced with "$".
2. Usage of Kubernetes variable references such as `$(MY_ENV_VAR)` will not work as expected.
An init container writes your script to disk before your `Step` can execute it and the `env`
of the init container differs from that of your `Step`.

For more information about Kubernetes variable references see the
[Kubernetes docs for the args field](https://kubernetes.io/docs/reference/kubernetes-api/workload-resources/pod-v1/#entrypoint).

#### Specifying a timeout

A `Step` can specify a `timeout` field.
Expand Down