Skip to content

[release/1.6] Bug fix for mount path handling#6929

Merged
kevpar merged 1 commit intocontainerd:release/1.6from
ambarve:backport_path_fix
May 18, 2022
Merged

[release/1.6] Bug fix for mount path handling#6929
kevpar merged 1 commit intocontainerd:release/1.6from
ambarve:backport_path_fix

Conversation

@ambarve
Copy link
Copy Markdown
Contributor

@ambarve ambarve commented May 11, 2022

Currently when handling 'container_path' elements in container mounts we simply call
filepath.Clean on those paths. However, filepath.Clean adds an extra '.' if the path is a
simple drive letter ('E:' or 'Z:' etc.). These type of paths cause failures (with incorrect
parameter error) when creating containers via hcsshim. This commit checks for such paths
and doesn't call filepath.Clean on them.
It also adds a new check to error out if the destination path is a C drive and moves the
dst path checks out of the named pipe condition.

Signed-off-by: Amit Barve [email protected]
(cherry picked from commit bfde58e)
Signed-off-by: Amit Barve [email protected]

Currently when handling 'container_path' elements in container mounts we simply call
filepath.Clean on those paths. However, filepath.Clean adds an extra '.' if the path is a
simple drive letter ('E:' or 'Z:' etc.). These type of paths cause failures (with incorrect
parameter error) when creating containers via hcsshim. This commit checks for such paths
and doesn't call filepath.Clean on them.
It also adds a new check to error out if the destination path is a C drive and moves the
dst path checks out of the named pipe condition.

Signed-off-by: Amit Barve <[email protected]>
(cherry picked from commit bfde58e)
Signed-off-by: Amit Barve <[email protected]>
@k8s-ci-robot
Copy link
Copy Markdown

Hi @ambarve. Thanks for your PR.

I'm waiting for a containerd member to verify that this patch is reasonable to test. If it is, they should reply with /ok-to-test on its own line. Until that is done, I will not automatically test new commits in this PR, but the usual testing commands by org members will still work. Regular contributors should join the org to skip this step.

Once the patch is verified, the new status will be reflected by the ok-to-test label.

I understand the commands that are listed here.

Details

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository.

@estesp estesp changed the title Backport Bug fix for mount path handling to 1.6 [release/1.6] backport: Bug fix for mount path handling to 1.6 May 11, 2022
@estesp
Copy link
Copy Markdown
Member

estesp commented May 11, 2022

Backport of #6651

@kevpar kevpar changed the title [release/1.6] backport: Bug fix for mount path handling to 1.6 [release/1.6] Bug fix for mount path handling May 11, 2022
Copy link
Copy Markdown
Member

@kevpar kevpar left a comment

Choose a reason for hiding this comment

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

LGTM. CI failure looks like a flake, as it's on Linux and this change only touches _windows files.

Copy link
Copy Markdown
Member

@dcantah dcantah left a comment

Choose a reason for hiding this comment

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

LGTM

@kevpar kevpar merged commit c6e0095 into containerd:release/1.6 May 18, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants