Skip to content

Commit

Permalink
addressed feedback
Browse files Browse the repository at this point in the history
  • Loading branch information
droot committed May 19, 2021
1 parent 4ab5d91 commit ff7b290
Show file tree
Hide file tree
Showing 4 changed files with 26 additions and 26 deletions.
4 changes: 2 additions & 2 deletions internal/docs/generated/fndocs/docs.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

30 changes: 15 additions & 15 deletions site/reference/fn/eval/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,13 +22,13 @@ Refer to the [Imperative Function Execution] for detailed overview.

<!--mdtogo:Long-->

```shell
```
kpt fn eval [DIR|-] [flags] [-- fn-args]
```

#### Args

```shell
```
DIR|-:
Path to the local directory containing resources. Defaults to the current
working directory. Using '-' as the directory path will cause `eval` to
Expand All @@ -37,22 +37,22 @@ DIR|-:
1. Multi object YAML where resources are separated by `---`.
2. [Function Specification] wire format where resources are wrapped in an object
of kind ResourceList. Refer to [Function Specification] format for more details.
2. `Function Specification` wire format where resources are wrapped in an object
of kind ResourceList.
If the output is written to `stdout`, resources are written in multi object YAML
format where resources are separated by `---`.
```

```shell
```
fn-args:
function arguments to be provided as input to the function. These must be
provided in the `key=value` format and come after the separator `--`.
```

#### Flags

```shell
```
--as-current-user:
Use the `uid` and `gid` of the kpt process for container function execution.
By default, container function is executed as `nobody` user. You may want to use
Expand Down Expand Up @@ -107,55 +107,55 @@ fn-args:
## Examples
<!--mdtogo:Examples-->

```shell
```
# execute container my-fn on the resources in DIR directory and
# write output back to DIR
$ kpt fn eval DIR --image gcr.io/example.com/my-fn
```

```shell
```
# execute container my-fn on the resources in DIR directory with
# `functionConfig` my-fn-config
$ kpt fn eval DIR --image gcr.io/example.com/my-fn --fn-config my-fn-config
```

```shell
```
# execute container my-fn with an input ConfigMap containing `data: {foo: bar}`
$ kpt fn eval DIR --image gcr.io/example.com/my-fn:v1.0.0 -- foo=bar
```

```shell
```
# execute executable my-fn on the resources in DIR directory and
# write output back to DIR
$ kpt fn eval DIR --exec-path ./my-fn
```

```shell
```
# execute container my-fn on the resources in DIR directory,
# save structured results in /tmp/my-results dir and write output back to DIR
$ kpt fn eval DIR --image gcr.io/example.com/my-fn --results-dir /tmp/my-results-dir
```

```shell
```
# execute container my-fn on the resources in DIR directory with network access enabled,
# and write output back to DIR
$ kpt fn eval DIR --image gcr.io/example.com/my-fn --network
```

```shell
```
# execute container my-fn on the resource in DIR and export KUBECONFIG
# and foo environment variable
$ kpt fn eval DIR --image gcr.io/example.com/my-fn --env KUBECONFIG -e foo=bar
```

```shell
```
# execute kubeval function by mounting schema from a local directory on wordpress package
$ kpt fn eval --image gcr.io/kpt-fn/kubeval:v0.1 \
--mount type=bind,src="/path/to/schema-dir",dst=/schema-dir \
--as-current-user wordpress -- additional_schema_locations=/schema-dir
```

```shell
```
# chaining functions using the unix pipe to set namespace and set labels on
# wordpress package
$ kpt fn source wordpress \
Expand Down
8 changes: 4 additions & 4 deletions site/reference/fn/sink/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@ Resources must be in one of the following input formats:

1. Multi object YAML where resources are separated by `---`.

2. [Function Specification] wire format where resources are wrapped in an object
of kind ResourceList. Refer to [Function Specification] format for more details.
2. `Function Specification` wire format where resources are wrapped in an object
of kind ResourceList.

`sink` is useful for chaining functions using Unix pipe. For more details,
refer to [Chaining functions].
Expand All @@ -25,7 +25,7 @@ refer to [Chaining functions].

<!--mdtogo:Long-->

```shell
```
kpt fn sink DIR [flags]
DIR:
Expand All @@ -38,7 +38,7 @@ DIR:

<!--mdtogo:Examples-->

```shell
```
# read resources from DIR directory, execute my-fn on them and write the
# output to DIR directory.
$ kpt fn source DIR |
Expand Down
10 changes: 5 additions & 5 deletions site/reference/fn/source/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,21 +20,21 @@ is useful for chaining functions using Unix pipe. For more details, refer to

<!--mdtogo:Long-->

```shell
```
kpt fn source [DIR] [flags]
```

#### Args

```shell
```
DIR:
Path to the local directory containing resources. Defaults to the current
working directory.
```

#### Flags

```shell
```
--fn-config:
Path to the file containing `functionConfig`.
Expand All @@ -45,12 +45,12 @@ DIR:

<!--mdtogo:Examples-->

```shell
```
# read resources from DIR directory and write the output on stdout.
$ kpt fn source DIR
```

```shell
```
# read resources from DIR directory, execute my-fn on them and write the
# output to DIR directory.
$ kpt fn source DIR |
Expand Down

0 comments on commit ff7b290

Please sign in to comment.