mirror of
https://github.com/kubernetes-sigs/kustomize.git
synced 2026-05-17 18:25:26 +00:00
Allow declaratively running starlark functions
This commit is contained in:
@@ -217,8 +217,8 @@ func toStorageMounts(mounts []string) []filters.StorageMount {
|
||||
}
|
||||
|
||||
func (r *RunFnRunner) preRunE(c *cobra.Command, args []string) error {
|
||||
if r.EnableStar != (r.StarPath != "") {
|
||||
return errors.Errorf("must specify --star-path with --enable-star")
|
||||
if !r.EnableStar && r.StarPath != "" {
|
||||
return errors.Errorf("must specify --enable-star with --star-path")
|
||||
}
|
||||
|
||||
if c.ArgsLenAtDash() >= 0 && r.Image == "" &&
|
||||
|
||||
@@ -183,7 +183,7 @@ apiVersion: v1
|
||||
"--star-name", "foo",
|
||||
"--", "Foo", "g=h"},
|
||||
path: "dir",
|
||||
err: "must specify --star-path with --enable-star",
|
||||
err: "must specify --enable-star with --star-path",
|
||||
},
|
||||
{
|
||||
name: "image-star-not-enabled",
|
||||
@@ -193,7 +193,17 @@ apiVersion: v1
|
||||
"--star-name", "foo",
|
||||
"--", "Foo", "g=h"},
|
||||
path: "dir",
|
||||
err: "must specify --star-path with --enable-star",
|
||||
err: "must specify --enable-star with --star-path",
|
||||
},
|
||||
{
|
||||
name: "star-enabled",
|
||||
args: []string{"run", "dir", "--enable-star"},
|
||||
path: "dir",
|
||||
expectedStruct: &runfn.RunFns{
|
||||
Path: "dir",
|
||||
NetworkName: "bridge",
|
||||
EnableStarlark: true,
|
||||
},
|
||||
},
|
||||
{
|
||||
name: "function paths",
|
||||
|
||||
Reference in New Issue
Block a user