-
Notifications
You must be signed in to change notification settings - Fork 2.4k
Description
When using a container-based transformer with a volume type storage mount, kustomize build incorrectly
converts the volume name to an absolute host path.
For example, given a transformer like:
apiVersion: example.com/v1
kind: MyProcessor
metadata:
name: my-processor
annotations:
config.kubernetes.io/function: |
container:
image: my-registry/my-plugin:latest
mounts:
- src: my-volume
dst: /data
type: volume
Running kustomize build --enable-alpha-plugins produces a Docker command with:
--mount type=volume,source=/current/working/dir/my-volume,target=/data
instead of the correct:
--mount type=volume,source=my-volume,target=/data
This happens because commit 9d5491c added relative-to-absolute path conversion for all StorageMount.Src
values. This is correct for bind mounts (Docker requires absolute paths for those), but for volume
mounts the source is a Docker volume name, not a filesystem path.
Expected behavior: Volume mount sources should be passed through as-is. Only bind mount sources should
have relative paths converted to absolute.