Skip to content

Conversation

@zhouhao3
Copy link

According to the spec.

On Windows, path MUST be a volume GUID path.

Signed-off-by: zhouhao zhouhao@cn.fujitsu.com

@zhouhao3 zhouhao3 force-pushed the windows-root-path branch 2 times, most recently from e17a31d to e59ea68 Compare September 14, 2017 07:17
@Mashimiao Mashimiao added this to the v0.2.0 milestone Sep 15, 2017
}

if v.platform == "windows" {
if !strings.HasPrefix(v.spec.Root.Path, `\\?\`) {
Copy link
Contributor

@wking wking Sep 15, 2017

Choose a reason for hiding this comment

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

We can be stricter than this. The spec links here, which would be a regex like [\][\][?][\]Volume[ {][a-fA-F0-9]{8}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{12}[}][\]?". The Windows docs say "GUID", I think they mean "UUID", based on their \\?\Volume{26a21bda-a627-11d7-9931-806e6f6e6963}\ example.

Also, unit tests :).

Copy link
Author

Choose a reason for hiding this comment

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

updated, PTAL.

@zhouhao3 zhouhao3 force-pushed the windows-root-path branch 4 times, most recently from 0e1633c to ec26a84 Compare September 18, 2017 09:26
}{
{rspec.Spec{Windows: &rspec.Windows{HyperV: &rspec.WindowsHyperV{}}, Root: &rspec.Root{}}, "windows", specerror.RootOnHyperV},
{rspec.Spec{Windows: &rspec.Windows{HyperV: &rspec.WindowsHyperV{}}, Root: nil}, "windows", specerror.NonError},
{rspec.Spec{Windows: &rspec.Windows{}, Root: &rspec.Root{Path: filepath.Join(tmpBundle, "rootfs")}}, "windows", specerror.PathFormatOnWindows},
Copy link
Contributor

Choose a reason for hiding this comment

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

Can we also check that this passes validation? The regex is large, and a positive match would help convince me that it wasn't broken.

Copy link
Author

Choose a reason for hiding this comment

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

updated.

@zhouhao3 zhouhao3 force-pushed the windows-root-path branch 6 times, most recently from d214edd to ab58414 Compare September 19, 2017 05:47
Signed-off-by: zhouhao <zhouhao@cn.fujitsu.com>
Signed-off-by: zhouhao <zhouhao@cn.fujitsu.com>
}

return nil
return validate.CapValid(cp, false)
Copy link
Contributor

Choose a reason for hiding this comment

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

I like this change, but it seems orthogonal. Can 1a9532e get its own PR?

Copy link
Contributor

@wking wking left a comment

Choose a reason for hiding this comment

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

All of this looks good to me, regardless of whether the generate commit is spun off.

@Mashimiao
Copy link

Mashimiao commented Sep 20, 2017

LGTM

Approved with PullApprove

@zhouhao3
Copy link
Author

ping @mrunalp @liangchenye

@liangchenye
Copy link
Member

liangchenye commented Sep 21, 2017

LGTM

Approved with PullApprove

@liangchenye liangchenye merged commit b00ed51 into opencontainers:master Sep 21, 2017
@zhouhao3 zhouhao3 deleted the windows-root-path branch September 21, 2017 03:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants