fix: container filesystem resolves symlinks correctly by jsternberg · Pull Request #6559 · moby/buildkit (original) (raw)

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm going to update this to another implementation that just trims the prefix. I think this is probably more complicated than it was intended. The intention was that the API was only supposed to accept absolute values. Using path.Join causes it to accept both absolute and relative paths which isn't the intention. At the same time, the current implementation accepts filepaths relative to the OS rather than only Unix filepaths which is the standard everywhere else.

It's probably better to just clean the path, check if the first character is a slash, then trim it. I'll also update the other functions to use the same utility.