mirror of
https://github.com/kubernetes-sigs/kustomize.git
synced 2026-06-11 17:12:51 +00:00
add --fn-user flag to function run
This commit is contained in:
@@ -203,6 +203,7 @@ apiVersion: v1
|
||||
Path: "dir",
|
||||
NetworkName: "bridge",
|
||||
EnableStarlark: true,
|
||||
User: "nobody",
|
||||
},
|
||||
},
|
||||
{
|
||||
@@ -256,6 +257,7 @@ apiVersion: v1
|
||||
Path: "dir",
|
||||
NetworkName: "bridge",
|
||||
ResultsDir: "foo/",
|
||||
User: "nobody",
|
||||
},
|
||||
expected: `
|
||||
metadata:
|
||||
@@ -283,6 +285,26 @@ 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",
|
||||
},
|
||||
expected: `
|
||||
metadata:
|
||||
name: function-input
|
||||
annotations:
|
||||
config.kubernetes.io/function: |
|
||||
container: {image: 'foo:bar'}
|
||||
data: {}
|
||||
kind: ConfigMap
|
||||
apiVersion: v1
|
||||
`,
|
||||
},
|
||||
}
|
||||
|
||||
for i := range tests {
|
||||
|
||||
Reference in New Issue
Block a user