mirror of
https://github.com/kubernetes-sigs/kustomize.git
synced 2026-06-11 17:12:51 +00:00
Added list of env variables for fn-plugins
KRM-functions should be able get env variables. Reflecting in `build` cmd args added in [1] for `fn run` cmd. [1] https://github.com/kubernetes-sigs/kustomize/pull/2988/
This commit is contained in:
@@ -78,6 +78,7 @@ func NewFnPlugin(o *types.FnPluginLoadingOptions) *FnPlugin {
|
||||
EnableStarlark: o.EnableStar,
|
||||
EnableExec: o.EnableExec,
|
||||
StorageMounts: toStorageMounts(o.Mounts),
|
||||
Env: o.Env,
|
||||
},
|
||||
}
|
||||
}
|
||||
|
||||
@@ -53,4 +53,6 @@ type FnPluginLoadingOptions struct {
|
||||
NetworkName string
|
||||
// list of mounts
|
||||
Mounts []string
|
||||
// list of env variables to pass to fn
|
||||
Env []string
|
||||
}
|
||||
|
||||
@@ -90,6 +90,9 @@ func NewCmdBuild(out io.Writer) *cobra.Command {
|
||||
cmd.Flags().StringArrayVar(
|
||||
&o.fnOptions.Mounts, "mount", []string{},
|
||||
"a list of storage options read from the filesystem")
|
||||
cmd.Flags().StringArrayVarP(
|
||||
&o.fnOptions.Env, "env", "e", []string{},
|
||||
"a list of environment variables to be used by functions")
|
||||
|
||||
addFlagLoadRestrictor(cmd.Flags())
|
||||
addFlagEnablePlugins(cmd.Flags())
|
||||
|
||||
Reference in New Issue
Block a user