remove --fn-user and --fn-env flags

This commit is contained in:
Donny Xia
2020-08-28 10:42:30 -07:00
parent e6ea4ad260
commit 91b779269f
2 changed files with 0 additions and 55 deletions

View File

@@ -65,11 +65,6 @@ func GetRunFnRunner(name string) *RunFnRunner {
r.Command.Flags().StringArrayVar(
&r.Mounts, "mount", []string{},
"a list of storage options read from the filesystem")
r.Command.Flags().StringVar(
&r.User, "fn-user", "nobody", "the username/uid used to run function in container")
r.Command.Flags().StringArrayVar(
&r.Env, "fn-env", []string{},
"a list of environment variables that will be exposed to container. Each item can be key=value pair or a key name of exported env.")
return r
}
@@ -96,8 +91,6 @@ type RunFnRunner struct {
Network bool
NetworkName string
Mounts []string
User string
Env []string
}
func (r *RunFnRunner) runE(c *cobra.Command, args []string) error {
@@ -312,8 +305,6 @@ func (r *RunFnRunner) preRunE(c *cobra.Command, args []string) error {
EnableExec: r.EnableExec,
StorageMounts: storageMounts,
ResultsDir: r.ResultsDir,
User: runtimeutil.ContainerUser(r.User),
Env: r.Env,
}
// don't consider args for the function

View File

@@ -203,8 +203,6 @@ apiVersion: v1
Path: "dir",
NetworkName: "bridge",
EnableStarlark: true,
User: "nobody",
Env: []string{},
},
},
{
@@ -258,8 +256,6 @@ apiVersion: v1
Path: "dir",
NetworkName: "bridge",
ResultsDir: "foo/",
User: "nobody",
Env: []string{},
},
expected: `
metadata:
@@ -287,48 +283,6 @@ apiVersion: v1
args: []string{"run", "dir", "--image", "foo:bar", "--", "a=b", "c", "e=f"},
err: "must have keys and values separated by",
},
{
name: "specify username",
args: []string{"run", "dir", "--fn-user", "root", "--image", "foo:bar"},
path: "dir",
expectedStruct: &runfn.RunFns{
Path: "dir",
NetworkName: "bridge",
User: "root",
Env: []string{},
},
expected: `
metadata:
name: function-input
annotations:
config.kubernetes.io/function: |
container: {image: 'foo:bar'}
data: {}
kind: ConfigMap
apiVersion: v1
`,
},
{
name: "specify env",
args: []string{"run", "dir", "--fn-env", "foo=bar", "--fn-env", "baz", "--image", "foo:bar"},
path: "dir",
expectedStruct: &runfn.RunFns{
Path: "dir",
NetworkName: "bridge",
User: "nobody",
Env: []string{"foo=bar", "baz"},
},
expected: `
metadata:
name: function-input
annotations:
config.kubernetes.io/function: |
container: {image: 'foo:bar'}
data: {}
kind: ConfigMap
apiVersion: v1
`,
},
}
for i := range tests {