mirror of
https://github.com/kubernetes-sigs/kustomize.git
synced 2026-05-17 18:25:26 +00:00
Merge pull request #3996 from khrisrichardson/kustomize-build-as-current-user
expose --as-current-user flag to kustomize build command
This commit is contained in:
@@ -78,6 +78,7 @@ func NewFnPlugin(o *types.FnPluginLoadingOptions) *FnPlugin {
|
||||
EnableExec: o.EnableExec,
|
||||
StorageMounts: toStorageMounts(o.Mounts),
|
||||
Env: o.Env,
|
||||
AsCurrentUser: o.AsCurrentUser,
|
||||
},
|
||||
}
|
||||
}
|
||||
|
||||
@@ -42,7 +42,7 @@ const (
|
||||
BploLoadFromFileSys
|
||||
)
|
||||
|
||||
// FnPluginLoadingOptions set way functions-based pluing are restricted
|
||||
// FnPluginLoadingOptions set way functions-based plugins are restricted
|
||||
type FnPluginLoadingOptions struct {
|
||||
// Allow to run executables
|
||||
EnableExec bool
|
||||
@@ -55,4 +55,6 @@ type FnPluginLoadingOptions struct {
|
||||
Mounts []string
|
||||
// list of env variables to pass to fn
|
||||
Env []string
|
||||
// Run as uid and gid of the command executor
|
||||
AsCurrentUser bool
|
||||
}
|
||||
|
||||
@@ -72,7 +72,7 @@ func GetRunFnRunner(name string) *RunFnRunner {
|
||||
&r.Env, "env", "e", []string{},
|
||||
"a list of environment variables to be used by functions")
|
||||
r.Command.Flags().BoolVar(
|
||||
&r.AsCurrentUser, "as-current-user", false, "use the uid and gid that kpt is running with to run the function in the container")
|
||||
&r.AsCurrentUser, "as-current-user", false, "use the uid and gid of the command executor to run the function in the container")
|
||||
return r
|
||||
}
|
||||
|
||||
|
||||
@@ -20,6 +20,9 @@ func AddFunctionBasicsFlags(set *pflag.FlagSet) {
|
||||
set.StringArrayVarP(
|
||||
&theFlags.fnOptions.Env, "env", "e", []string{},
|
||||
"a list of environment variables to be used by functions")
|
||||
set.BoolVar(
|
||||
&theFlags.fnOptions.AsCurrentUser, "as-current-user", false,
|
||||
"use the uid and gid of the command executor to run the function in the container")
|
||||
}
|
||||
|
||||
func AddFunctionAlphaEnablementFlags(set *pflag.FlagSet) {
|
||||
|
||||
Reference in New Issue
Block a user