diff --git a/kyaml/fn/runtime/runtimeutil/functiontypes.go b/kyaml/fn/runtime/runtimeutil/functiontypes.go index 9bd396d30..6e476e871 100644 --- a/kyaml/fn/runtime/runtimeutil/functiontypes.go +++ b/kyaml/fn/runtime/runtimeutil/functiontypes.go @@ -166,9 +166,9 @@ func StringToStorageMount(s string) StorageMount { switch { case key == "type": sm.MountType = value - case key == "src": + case key == "src" || key == "source": sm.Src = value - case key == "dst": + case key == "dst" || key == "target": sm.DstPath = value case key == "rw" && value == "true": sm.ReadWriteMode = true diff --git a/kyaml/fn/runtime/runtimeutil/runtimeutil_test.go b/kyaml/fn/runtime/runtimeutil/runtimeutil_test.go index cbffcf042..89b728cf1 100644 --- a/kyaml/fn/runtime/runtimeutil/runtimeutil_test.go +++ b/kyaml/fn/runtime/runtimeutil/runtimeutil_test.go @@ -1413,6 +1413,14 @@ func Test_StringToStorageMount(t *testing.T) { in: "type=tmpfs,src=/tmp/test/,dst", expectedOut: "type=tmpfs,source=/tmp/test/,target=,readonly", }, + { + in: "type=bind,source=/tmp/test/,target=/tmp/source/,rw=true", + expectedOut: "type=bind,source=/tmp/test/,target=/tmp/source/", + }, + { + in: "type=bind,source=/tmp/test/,target=/tmp/source/", + expectedOut: "type=bind,source=/tmp/test/,target=/tmp/source/,readonly", + }, } for _, tc := range tests {