Skip to content

Commit

Permalink
Fix eval render reference docs (#2172)
Browse files Browse the repository at this point in the history
* Fix eval render reference docs

* Fix book
  • Loading branch information
phanimarupaka committed Jun 6, 2021
1 parent 312cba6 commit 07d0269
Show file tree
Hide file tree
Showing 5 changed files with 14 additions and 22 deletions.
14 changes: 5 additions & 9 deletions internal/docs/generated/fndocs/docs.go

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

Expand Up @@ -156,8 +156,8 @@ Here is an example:

```shell
$ kpt fn source wordpress \
| kpt fn eval - --image gcr.io/kpt-fn/set-namespace:v0.1 - -- namespace=mywordpress \
| kpt fn eval - --image gcr.io/kpt-fn/set-labels:v0.1 - -- app=wordpress env=prod \
| kpt fn eval - --image gcr.io/kpt-fn/set-namespace:v0.1 -- namespace=mywordpress \
| kpt fn eval - --image gcr.io/kpt-fn/set-labels:v0.1 -- app=wordpress env=prod \
| kpt fn sink wordpress
```

Expand Down
12 changes: 4 additions & 8 deletions site/reference/cli/fn/eval/README.md
Expand Up @@ -58,10 +58,6 @@ fn-args:
By default, container function is executed as `nobody` user. You may want to use
this flag to run higher privilege operations such as mounting the local filesystem.
--dry-run:
If enabled, the resources are not written to local filesystem, instead they
are written to stdout. By defaults it is disabled.
--env, e:
List of local environment variables to be exported to the container function.
By default, none of local environment variables are made available to the
Expand Down Expand Up @@ -178,8 +174,8 @@ $ kpt fn eval -i gcr.io/kpt-fn/kubeval:v0.1 \
# chaining functions using the unix pipe to set namespace and set labels on
# wordpress package
$ kpt fn source wordpress \
| kpt fn eval - -i gcr.io/kpt-fn/set-namespace:v0.1 - -- namespace=mywordpress \
| kpt fn eval - -i gcr.io/kpt-fn/set-labels:v0.1 - -- label_name=color label_value=orange \
| kpt fn eval - -i gcr.io/kpt-fn/set-namespace:v0.1 -- namespace=mywordpress \
| kpt fn eval - -i gcr.io/kpt-fn/set-labels:v0.1 -- label_name=color label_value=orange \
| kpt fn sink wordpress
```

Expand All @@ -193,14 +189,14 @@ $ kpt fn eval -i gcr.io/kpt-fn/set-namespace:v0.1 -o path/to/dir -- namespace=my
# execute container 'set-namespace' on the resources in current directory and write
# the output resources to stdout which are piped to 'kubectl apply'
$ kpt fn eval -i gcr.io/kpt-fn/set-namespace:v0.1 -o unwrap -- namespace=mywordpress \
| kubectl apply -
| kubectl apply -f -
```

```shell
# execute container 'set-namespace' on the resources in current directory and write
# the wrapped output resources to stdout which are passed to 'set-annotations' function
# and the output resources after setting namespace and annotation is written to another directory
$ kpt fn eval -i gcr.io/kpt-fn/set-namespace:v0.1 -o stdout \
$ kpt fn eval -i gcr.io/kpt-fn/set-namespace:v0.1 -o stdout -- namespace=staging \
| kpt fn eval - -i gcr.io/kpt-fn/set-annotations:v0.1.3 -o path/to/dir -- foo=bar
```

Expand Down
2 changes: 1 addition & 1 deletion site/reference/cli/fn/render/README.md
Expand Up @@ -97,7 +97,7 @@ $ kpt fn render -o path/to/dir
```shell
# Render resources in current directory and write unwrapped resources to stdout
# which can be piped to kubectl apply
$ kpt fn render -o unwrap | kubectl apply -
$ kpt fn render -o unwrap | kubectl apply -f -
```
```shell
Expand Down
4 changes: 2 additions & 2 deletions thirdparty/cmdconfig/commands/cmdeval/cmdeval.go
Expand Up @@ -38,8 +38,8 @@ func GetEvalFnRunner(ctx context.Context, parent string) *EvalFnRunner {
r.Command = c
r.Command.Flags().StringVarP(&r.Dest, "output", "o", "",
fmt.Sprintf("output resources are written to provided location. Allowed values: %s|%s|<OUT_DIR_PATH>", cmdutil.Stdout, cmdutil.Unwrap))
r.Command.Flags().StringVar(
&r.Image, "image", "", "run this image as a function")
r.Command.Flags().StringVarP(
&r.Image, "image", "i", "", "run this image as a function")
r.Command.Flags().StringVar(
&r.ExecPath, "exec-path", "", "run an executable as a function.")
r.Command.Flags().StringVar(
Expand Down

0 comments on commit 07d0269

Please sign in to comment.