-
Notifications
You must be signed in to change notification settings - Fork 164
Open
Description
Currently, runtime volumes defined in func.yaml are ignored when running functions locally with func run.
We should update pkg/docker/runner.go -> newHostConfig() to configure volumes in addition to the ports it currently defines.
- ConfigMap → Local
.func/run/configmaps/<name>directory - Secret → Local
.func/run/secrets/<name>directory - EmptyDir → Docker tmpfs or anonymous volume
- PersistentVolumeClaim → Named Docker volume or local directory
Additionally, we could consider adding a new volume type specifically for local development:
volumes:
- hostPath: /local/path
path: /container/pathImplementation Notes:
There should be warnings when defined resources are note available locally, but not fail.
Should disallow mapping of directories outside of .func for security (example risk: user downloads a malicious function, runs it locally, accessing sensitive areas of the FS and exfiltrating via the funciton source implementation)
Current Workarounds
- Use the "host" builder (loses container isolation)
- Run
func buildthen manuallydocker run -v local:container image - Deploy to a test cluster for volume testing
Metadata
Metadata
Assignees
Labels
No labels