mirror of
https://github.com/kubernetes-sigs/kustomize.git
synced 2026-06-11 17:12:51 +00:00
fix containerized function mounts issue (#4489)
* fix containerized function mounts issue * skip path test on windows * move test out of temp dir * update tests to deal with new working dir restrictions * code review
This commit is contained in:
@@ -329,8 +329,11 @@ func (r RunFns) getFunctionFilters(global bool, fns ...*yaml.RNode) (
|
||||
continue
|
||||
}
|
||||
cf, ok := c.(*container.Filter)
|
||||
if global && ok {
|
||||
cf.Exec.GlobalScope = true
|
||||
if ok {
|
||||
if global {
|
||||
cf.Exec.GlobalScope = true
|
||||
}
|
||||
cf.Exec.WorkingDir = r.WorkingDir
|
||||
}
|
||||
fltrs = append(fltrs, c)
|
||||
}
|
||||
@@ -468,11 +471,17 @@ func (r *RunFns) ffp(spec runtimeutil.FunctionSpec, api *yaml.RNode, currentUser
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
// Storage mounts can either come from kustomize fn run --mounts,
|
||||
// or from the declarative function mounts field.
|
||||
storageMounts := spec.Container.StorageMounts
|
||||
storageMounts = append(storageMounts, r.StorageMounts...)
|
||||
|
||||
c := container.NewContainer(
|
||||
runtimeutil.ContainerSpec{
|
||||
Image: spec.Container.Image,
|
||||
Network: spec.Container.Network,
|
||||
StorageMounts: r.StorageMounts,
|
||||
StorageMounts: storageMounts,
|
||||
Env: spec.Container.Env,
|
||||
},
|
||||
uidgid,
|
||||
|
||||
Reference in New Issue
Block a user