Skip to content

Commit

Permalink
doc: add documentation on naming functions in a Kptfile (#4010)
Browse files Browse the repository at this point in the history
  • Loading branch information
michaelvl committed Aug 14, 2023
1 parent 36120be commit 30272c9
Showing 1 changed file with 27 additions and 0 deletions.
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

0 comments on commit 30272c9

Please sign in to comment.