mirror of
https://github.com/kubernetes-sigs/kustomize.git
synced 2026-06-11 17:12:51 +00:00
drop short-hand flags from config run command
This commit is contained in:
@@ -34,11 +34,11 @@ func GetRunFnRunner(name string) *RunFnRunner {
|
|||||||
&r.DryRun, "dry-run", false, "print results to stdout")
|
&r.DryRun, "dry-run", false, "print results to stdout")
|
||||||
r.Command.Flags().BoolVar(
|
r.Command.Flags().BoolVar(
|
||||||
&r.GlobalScope, "global-scope", false, "set global scope for functions.")
|
&r.GlobalScope, "global-scope", false, "set global scope for functions.")
|
||||||
r.Command.Flags().StringSliceVarP(
|
r.Command.Flags().StringSliceVar(
|
||||||
&r.FnPaths, "fn-path", "p", []string{},
|
&r.FnPaths, "fn-path", []string{},
|
||||||
"read functions from these directories instead of the configuration directory.")
|
"read functions from these directories instead of the configuration directory.")
|
||||||
r.Command.Flags().StringVarP(
|
r.Command.Flags().StringVar(
|
||||||
&r.Image, "image", "i", "",
|
&r.Image, "image", "",
|
||||||
"run this image as a function instead of discovering them.")
|
"run this image as a function instead of discovering them.")
|
||||||
return r
|
return r
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -90,7 +90,7 @@ apiVersion: v1
|
|||||||
},
|
},
|
||||||
{
|
{
|
||||||
name: "custom kind",
|
name: "custom kind",
|
||||||
args: []string{"run", "dir", "-i", "foo:bar", "--", "Foo", "g=h"},
|
args: []string{"run", "dir", "--image", "foo:bar", "--", "Foo", "g=h"},
|
||||||
path: "dir",
|
path: "dir",
|
||||||
expected: `
|
expected: `
|
||||||
metadata:
|
metadata:
|
||||||
@@ -105,7 +105,7 @@ apiVersion: v1
|
|||||||
},
|
},
|
||||||
{
|
{
|
||||||
name: "custom kind '=' in data",
|
name: "custom kind '=' in data",
|
||||||
args: []string{"run", "dir", "-i", "foo:bar", "--", "Foo", "g=h", "i=j=k"},
|
args: []string{"run", "dir", "--image", "foo:bar", "--", "Foo", "g=h", "i=j=k"},
|
||||||
path: "dir",
|
path: "dir",
|
||||||
expected: `
|
expected: `
|
||||||
metadata:
|
metadata:
|
||||||
@@ -120,14 +120,14 @@ apiVersion: v1
|
|||||||
},
|
},
|
||||||
{
|
{
|
||||||
name: "function paths",
|
name: "function paths",
|
||||||
args: []string{"run", "dir", "-p", "path1", "--fn-path", "path2"},
|
args: []string{"run", "dir", "--fn-path", "path1", "--fn-path", "path2"},
|
||||||
path: "dir",
|
path: "dir",
|
||||||
functionPaths: []string{"path1", "path2"},
|
functionPaths: []string{"path1", "path2"},
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
name: "custom kind with function paths",
|
name: "custom kind with function paths",
|
||||||
args: []string{
|
args: []string{
|
||||||
"run", "dir", "-p", "path", "-i", "foo:bar", "--", "Foo", "g=h", "i=j=k"},
|
"run", "dir", "--fn-path", "path", "--image", "foo:bar", "--", "Foo", "g=h", "i=j=k"},
|
||||||
path: "dir",
|
path: "dir",
|
||||||
functionPaths: []string{"path"},
|
functionPaths: []string{"path"},
|
||||||
expected: `
|
expected: `
|
||||||
|
|||||||
Reference in New Issue
Block a user