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

doc: add documentation on naming functions in a Kptfile #4010

Merged
merged 2 commits into from
Aug 14, 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
27 changes: 27 additions & 0 deletions site/book/04-using-functions/01-declarative-function-execution.md
Original file line number Diff line number Diff line change
Expand Up @@ -213,6 +213,33 @@ pipeline:
tier: mysql
```

## Specifying function `name`

Functions can optionally be named using the `pipeline.mutators.name`
or `pipeline.validators.name` field to identify a function.

For example:

```yaml
# wordpress/mysql/Kptfile
apiVersion: kpt.dev/v1
kind: Kptfile
metadata:
name: mysql
pipeline:
mutators:
- name: set tier label
image: set-labels:v0.1
configMap:
tier: mysql
```

Unique function names for all functions in the Kptfile function
pipeline is recommended. If `name` is specified, `kpt pkg update`
will merge each function pipeline list as an associative list, using
`name` as the merge key. An unspecified `name` or duplicated names may
result in unexpected merges.

## Specifying `selectors`

In some cases, you want to invoke the function only on a subset of resources based on a
Expand Down