Skip to content

Commit 3529a51

Browse files
rename exec-path to exec (#2265)
1 parent 33c62d9 commit 3529a51

File tree

6 files changed

+15
-18
lines changed

6 files changed

+15
-18
lines changed

internal/docs/generated/fndocs/docs.go

Lines changed: 3 additions & 3 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

pkg/test/runner/runner.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -193,7 +193,7 @@ func (r *Runner) runFnEval() error {
193193
if r.testCase.Config.EvalConfig.Image != "" {
194194
kptArgs = append(kptArgs, "--image", r.testCase.Config.EvalConfig.Image)
195195
} else if !r.testCase.Config.EvalConfig.execUniquePath.Empty() {
196-
kptArgs = append(kptArgs, "--exec-path", string(r.testCase.Config.EvalConfig.execUniquePath))
196+
kptArgs = append(kptArgs, "--exec", string(r.testCase.Config.EvalConfig.execUniquePath))
197197
}
198198
if !r.testCase.Config.EvalConfig.fnConfigUniquePath.Empty() {
199199
kptArgs = append(kptArgs, "--fn-config", string(r.testCase.Config.EvalConfig.fnConfigUniquePath))

site/book/05-developing-functions/02-developing-in-Go.md

Lines changed: 5 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -76,10 +76,10 @@ $ kpt pkg get https://github.com/GoogleContainerTools/kpt.git/package-examples/w
7676
Test it by running the function imperatively:
7777

7878
```shell
79-
$ kpt fn eval wordpress --exec-path ./my-fn -- value=foo
79+
$ kpt fn eval wordpress --exec ./my-fn -- value=foo
8080
```
8181

82-
During iterative development, `--exec-path` flag can be used to execute the
82+
During iterative development, `--exec` flag can be used to execute the
8383
function binary directly instead of requiring the function to be containerized
8484
first. Once you have a function binary that works, you can then proceed to
8585
creating the container image.
@@ -122,9 +122,6 @@ $ kpt fn eval wordpress --image gcr.io/project/fn-name:tag -- value=foo
122122
- Take a look at the source code for [functions in the catalog] to better
123123
understand how to develop functions in Go
124124

125-
[sigs.k8s.io/kustomize/kyaml/fn/framework]:
126-
https://pkg.go.dev/sigs.k8s.io/kustomize/[email protected]/fn/framework#pkg-index
127-
[sigs.k8s.io/kustomize/kyaml/yaml]:
128-
https://pkg.go.dev/sigs.k8s.io/kustomize/[email protected]/yaml
129-
[functions in the catalog]:
130-
https://github.com/GoogleContainerTools/kpt-functions-catalog/tree/master/functions/go
125+
[sigs.k8s.io/kustomize/kyaml/fn/framework]: https://pkg.go.dev/sigs.k8s.io/kustomize/[email protected]/fn/framework#pkg-index
126+
[sigs.k8s.io/kustomize/kyaml/yaml]: https://pkg.go.dev/sigs.k8s.io/kustomize/[email protected]/yaml
127+
[functions in the catalog]: https://github.com/GoogleContainerTools/kpt-functions-catalog/tree/master/functions/go

site/reference/cli/fn/eval/README.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ fn-args:
6464
container running the function. The value can be in `key=value` format or only
6565
the key of an already exported environment variable.
6666
67-
--exec-path:
67+
--exec:
6868
Path to the local executable binary to execute as a function. `eval` executes
6969
only one function, so do not use `--image` flag with this flag. This is useful
7070
for testing function locally during development. It enables faster dev iterations
@@ -75,7 +75,7 @@ fn-args:
7575
7676
--image, i:
7777
Container image of the function to execute e.g. `gcr.io/kpt-fn/set-namespace:v0.1`.
78-
`eval` executes only one function, so do not use `--exec-path` flag with this flag.
78+
`eval` executes only one function, so do not use `--exec` flag with this flag.
7979
8080
--image-pull-policy:
8181
If the image should be pulled before rendering the package(s). It can be set
@@ -142,7 +142,7 @@ $ kpt fn eval DIR -i gcr.io/example.com/my-fn:v1.0.0 -- foo=bar
142142
```shell
143143
# execute executable my-fn on the resources in DIR directory and
144144
# write output back to DIR
145-
$ kpt fn eval DIR --exec-path ./my-fn
145+
$ kpt fn eval DIR --exec ./my-fn
146146
```
147147

148148
```shell

site/sdk/ts-guide.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -162,7 +162,7 @@ runtime.
162162
using the exec runtime.
163163

164164
```shell
165-
$ kpt fn eval DIR --exec-path ./my_func_run-macos
165+
$ kpt fn eval DIR --exec ./my_func_run-macos
166166
```
167167

168168
## Build and push container images

thirdparty/cmdconfig/commands/cmdeval/cmdeval.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ func GetEvalFnRunner(ctx context.Context, parent string) *EvalFnRunner {
4242
r.Command.Flags().StringVarP(
4343
&r.Image, "image", "i", "", "run this image as a function")
4444
r.Command.Flags().StringVar(
45-
&r.ExecPath, "exec-path", "", "run an executable as a function.")
45+
&r.ExecPath, "exec", "", "run an executable as a function.")
4646
r.Command.Flags().StringVar(
4747
&r.FnConfigPath, "fn-config", "", "path to the function config file")
4848
r.Command.Flags().BoolVar(
@@ -232,7 +232,7 @@ func checkFnConfigPathExistence(path string) error {
232232

233233
func (r *EvalFnRunner) preRunE(c *cobra.Command, args []string) error {
234234
if r.Image == "" && r.ExecPath == "" {
235-
return errors.Errorf("must specify --image or --exec-path")
235+
return errors.Errorf("must specify --image or --exec")
236236
}
237237
if r.Image != "" {
238238
err := cmdutil.DockerCmdAvailable()

0 commit comments

Comments
 (0)