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

Fix eval render reference docs #2172

Merged
merged 2 commits into from
Jun 6, 2021
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
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.

12 changes: 4 additions & 8 deletions site/reference/cli/fn/eval/README.md
Original file line number Diff line number Diff line change
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
Original file line number Diff line number Diff line change
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
Original file line number Diff line number Diff line change
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