This is the cause of the bug. The reason we have long weird relative paths in the m2k.plan file when using the UI is because MacOS creates a symbolic link from /var to the /private/var directory.
$ ls -la /
...
lrwxr-xr-x 1 root wheel 11 Feb 7 02:52 var -> private/var
...
Steps to reproduce
Do yarn run start in move2kube-ui on MacOS to start Move2Kube UI.
Upload language-platforms.zip and start planning in the UI.
The displayed plan file will contain a weird long relative path (example: ../../../../var/folders/......)
feat: copy over the m2k graph file into the output zip file
Bug
Overview
This is the cause of the bug. The reason we have long weird relative paths in the
m2k.plan
file when using the UI is because MacOS creates a symbolic link from/var
to the/private/var
directory.Steps to reproduce
yarn run start
inmove2kube-ui
on MacOS to start Move2Kube UI.language-platforms.zip
and start planning in the UI.../../../../var/folders/......
)Proposed fix
https://pkg.go.dev/path/filepath#EvalSymlinks Use
EvalSymlinks
to resolve the symbolic link before using it and giving it to functions likefilepath.Rel
, etc.