{"action":"created","comment":{"url":"https://api.github.com/repos/containerd/containerd/pulls/comments/181858409","pull_request_review_id":112556202,"id":181858409,"diff_hunk":"@@ -47,14 +51,67 @@ func (m *Mount) Mount(target string) error {\n \t\treturn errors.Wrapf(err, \"failed to activate layer %s\", m.Source)\n \t}\n \tdefer func() {\n-\t\tif err != nil {\n+\t\tif retErr != nil {\n \t\t\thcsshim.DeactivateLayer(di, layerID)\n \t\t}\n \t}()\n \n \tif err = hcsshim.PrepareLayer(di, layerID, parentLayerPaths); err != nil {\n \t\treturn errors.Wrapf(err, \"failed to prepare layer %s\", m.Source)\n \t}\n+\tlayerPath, err := hcsshim.GetLayerMountPath(di, layerID)\n+\tif err != nil {\n+\t\treturn errors.Wrapf(err, \"failed to get mount path for layer %s\", m.Source)\n+\t}\n+\n+\tif !strings.HasPrefix(layerPath, \"\\\\\\\\?\\\\\") {\n+\t\tlayerPath = filepath.Join(layerPath, \"Files\")\n+\t\tif _, err := os.Lstat(layerPath); err != nil {\n+\t\t\tif !os.IsNotExist(err) {\n+\t\t\t\treturn errors.Wrapf(err, \"failed to find Files dir\")\n+\t\t\t}\n+\t\t\tif err := os.Mkdir(layerPath, 0755); err != nil {\n+\t\t\t\treturn errors.Wrap(err, \"failed to create Files dir\")\n+\t\t\t}\n+\t\t}\n+\t\tif err := os.Remove(target); err != nil {\n+\t\t\treturn errors.Wrapf(err, \"remove target prior to mounting %q\", target)\n+\t\t}\n+\t\tif err := os.Symlink(layerPath, target); err != nil {\n+\t\t\treturn errors.Wrapf(err, \"failed to mount layer %q at %q\", m.Source, target)\n+\t\t}\n+\t} else {\n+\t\ttarget = filepath.Clean(target) + string(filepath.Separator)\n+\t\ttargetp, err := syscall.UTF16PtrFromString(target)\n+\t\tif err != nil {\n+\t\t\treturn err\n+\t\t}\n+\n+\t\tvolName := filepath.Clean(layerPath) + string(filepath.Separator)\n+\t\tvolNamep, err := syscall.UTF16PtrFromString(volName)\n+\t\tif err != nil {\n+\t\t\treturn err\n+\t\t}\n+\n+\t\tif err := windows.SetVolumeMountPoint(targetp, volNamep); err != nil {\n+\t\t\treturn errors.Wrapf(err, \"failed to mount layer %q at %q, volume: %q\", m.Source, target, volName)\n+\t\t}\n+\t}\n+\n+\tfor strings.HasSuffix(target, string(os.PathSeparator)) {\n+\t\ttarget = target[:len(target)-1]\n+\t}\n+\n+\tidf, err := os.Create(target + \":layerid\")","path":"mount/mount_windows.go","position":81,"original_position":81,"commit_id":"6be0fdd58eab566017817176a9b588ae2b6449ff","original_commit_id":"6be0fdd58eab566017817176a9b588ae2b6449ff","user":{"login":"darrenstahlmsft","id":14114019,"avatar_url":"https://avatars2.githubusercontent.com/u/14114019?v=4","gravatar_id":"","url":"https://api.github.com/users/darrenstahlmsft","html_url":"https://github.com/darrenstahlmsft","followers_url":"https://api.github.com/users/darrenstahlmsft/followers","following_url":"https://api.github.com/users/darrenstahlmsft/following{/other_user}","gists_url":"https://api.github.com/users/darrenstahlmsft/gists{/gist_id}","starred_url":"https://api.github.com/users/darrenstahlmsft/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/darrenstahlmsft/subscriptions","organizations_url":"https://api.github.com/users/darrenstahlmsft/orgs","repos_url":"https://api.github.com/users/darrenstahlmsft/repos","events_url":"https://api.github.com/users/darrenstahlmsft/events{/privacy}","received_events_url":"https://api.github.com/users/darrenstahlmsft/received_events","type":"User","site_admin":false},"body":"This is an alternate data stream on the mounted layer folder. Short version is that this is used to store extra data on the same file without affecting the actual file.\r\n\r\nDocs on alternate data streams that I can add in a comment https://blogs.technet.microsoft.com/askcore/2013/03/24/alternate-data-streams-in-ntfs/","created_at":"2018-04-16T19:29:33Z","updated_at":"2018-04-16T19:29:33Z","html_url":"https://github.com/containerd/containerd/pull/2287#discussion_r181858409","pull_request_url":"https://api.github.com/repos/containerd/containerd/pulls/2287","author_association":"CONTRIBUTOR","_links":{"self":{"href":"https://api.github.com/repos/containerd/containerd/pulls/comments/181858409"},"html":{"href":"https://github.com/containerd/containerd/pull/2287#discussion_r181858409"},"pull_request":{"href":"https://api.github.com/repos/containerd/containerd/pulls/2287"}},"in_reply_to_id":181848977},"pull_request":{"url":"https://api.github.com/repos/containerd/containerd/pulls/2287","id":181066809,"html_url":"https://github.com/containerd/containerd/pull/2287","diff_url":"https://github.com/containerd/containerd/pull/2287.diff","patch_url":"https://github.com/containerd/containerd/pull/2287.patch","issue_url":"https://api.github.com/repos/containerd/containerd/issues/2287","number":2287,"state":"open","locked":false,"title":"WIP: Mount Windows layers as volumes on the host","user":{"login":"darrenstahlmsft","id":14114019,"avatar_url":"https://avatars2.githubusercontent.com/u/14114019?v=4","gravatar_id":"","url":"https://api.github.com/users/darrenstahlmsft","html_url":"https://github.com/darrenstahlmsft","followers_url":"https://api.github.com/users/darrenstahlmsft/followers","following_url":"https://api.github.com/users/darrenstahlmsft/following{/other_user}","gists_url":"https://api.github.com/users/darrenstahlmsft/gists{/gist_id}","starred_url":"https://api.github.com/users/darrenstahlmsft/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/darrenstahlmsft/subscriptions","organizations_url":"https://api.github.com/users/darrenstahlmsft/orgs","repos_url":"https://api.github.com/users/darrenstahlmsft/repos","events_url":"https://api.github.com/users/darrenstahlmsft/events{/privacy}","received_events_url":"https://api.github.com/users/darrenstahlmsft/received_events","type":"User","site_admin":false},"body":"This is a work in progress implementation of mounting Windows volumes on the host. It currently is failing the Basic snapshotter test due to a few assumptions made by the tests. The first issue is that the root directory of the layer is a link, which is tripping up the filesystem differ. The second is mounting a parent and child layer at the same time is currently failing.\r\n\r\nThis PR is to share the current progress.\r\n\r\n/cc @johnstep @stevvooe @dmcgowan ","created_at":"2018-04-12T01:14:31Z","updated_at":"2018-04-16T19:29:33Z","closed_at":null,"merged_at":null,"merge_commit_sha":"17ff6b8fd0101483a6be45fc7fb9e159106ff110","assignee":null,"assignees":[],"requested_reviewers":[],"requested_teams":[],"labels":[],"milestone":{"url":"https://api.github.com/repos/containerd/containerd/milestones/17","html_url":"https://github.com/containerd/containerd/milestone/17","labels_url":"https://api.github.com/repos/containerd/containerd/milestones/17/labels","id":2989685,"number":17,"title":"1.2","description":"","creator":{"login":"stevvooe","id":120601,"avatar_url":"https://avatars1.githubusercontent.com/u/120601?v=4","gravatar_id":"","url":"https://api.github.com/users/stevvooe","html_url":"https://github.com/stevvooe","followers_url":"https://api.github.com/users/stevvooe/followers","following_url":"https://api.github.com/users/stevvooe/following{/other_user}","gists_url":"https://api.github.com/users/stevvooe/gists{/gist_id}","starred_url":"https://api.github.com/users/stevvooe/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/stevvooe/subscriptions","organizations_url":"https://api.github.com/users/stevvooe/orgs","repos_url":"https://api.github.com/users/stevvooe/repos","events_url":"https://api.github.com/users/stevvooe/events{/privacy}","received_events_url":"https://api.github.com/users/stevvooe/received_events","type":"User","site_admin":false},"open_issues":18,"closed_issues":1,"state":"open","created_at":"2017-12-19T20:28:17Z","updated_at":"2018-04-16T19:03:45Z","due_on":null,"closed_at":null},"commits_url":"https://api.github.com/repos/containerd/containerd/pulls/2287/commits","review_comments_url":"https://api.github.com/repos/containerd/containerd/pulls/2287/comments","review_comment_url":"https://api.github.com/repos/containerd/containerd/pulls/comments{/number}","comments_url":"https://api.github.com/repos/containerd/containerd/issues/2287/comments","statuses_url":"https://api.github.com/repos/containerd/containerd/statuses/6be0fdd58eab566017817176a9b588ae2b6449ff","head":{"label":"darrenstahlmsft:MountVol","ref":"MountVol","sha":"6be0fdd58eab566017817176a9b588ae2b6449ff","user":{"login":"darrenstahlmsft","id":14114019,"avatar_url":"https://avatars2.githubusercontent.com/u/14114019?v=4","gravatar_id":"","url":"https://api.github.com/users/darrenstahlmsft","html_url":"https://github.com/darrenstahlmsft","followers_url":"https://api.github.com/users/darrenstahlmsft/followers","following_url":"https://api.github.com/users/darrenstahlmsft/following{/other_user}","gists_url":"https://api.github.com/users/darrenstahlmsft/gists{/gist_id}","starred_url":"https://api.github.com/users/darrenstahlmsft/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/darrenstahlmsft/subscriptions","organizations_url":"https://api.github.com/users/darrenstahlmsft/orgs","repos_url":"https://api.github.com/users/darrenstahlmsft/repos","events_url":"https://api.github.com/users/darrenstahlmsft/events{/privacy}","received_events_url":"https://api.github.com/users/darrenstahlmsft/received_events","type":"User","site_admin":false},"repo":{"id":92104345,"name":"containerd","full_name":"darrenstahlmsft/containerd","owner":{"login":"darrenstahlmsft","id":14114019,"avatar_url":"https://avatars2.githubusercontent.com/u/14114019?v=4","gravatar_id":"","url":"https://api.github.com/users/darrenstahlmsft","html_url":"https://github.com/darrenstahlmsft","followers_url":"https://api.github.com/users/darrenstahlmsft/followers","following_url":"https://api.github.com/users/darrenstahlmsft/following{/other_user}","gists_url":"https://api.github.com/users/darrenstahlmsft/gists{/gist_id}","starred_url":"https://api.github.com/users/darrenstahlmsft/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/darrenstahlmsft/subscriptions","organizations_url":"https://api.github.com/users/darrenstahlmsft/orgs","repos_url":"https://api.github.com/users/darrenstahlmsft/repos","events_url":"https://api.github.com/users/darrenstahlmsft/events{/privacy}","received_events_url":"https://api.github.com/users/darrenstahlmsft/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/darrenstahlmsft/containerd","description":"An open and reliable container runtime","fork":true,"url":"https://api.github.com/repos/darrenstahlmsft/containerd","forks_url":"https://api.github.com/repos/darrenstahlmsft/containerd/forks","keys_url":"https://api.github.com/repos/darrenstahlmsft/containerd/keys{/key_id}","collaborators_url":"https://api.github.com/repos/darrenstahlmsft/containerd/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/darrenstahlmsft/containerd/teams","hooks_url":"https://api.github.com/repos/darrenstahlmsft/containerd/hooks","issue_events_url":"https://api.github.com/repos/darrenstahlmsft/containerd/issues/events{/number}","events_url":"https://api.github.com/repos/darrenstahlmsft/containerd/events","assignees_url":"https://api.github.com/repos/darrenstahlmsft/containerd/assignees{/user}","branches_url":"https://api.github.com/repos/darrenstahlmsft/containerd/branches{/branch}","tags_url":"https://api.github.com/repos/darrenstahlmsft/containerd/tags","blobs_url":"https://api.github.com/repos/darrenstahlmsft/containerd/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/darrenstahlmsft/containerd/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/darrenstahlmsft/containerd/git/refs{/sha}","trees_url":"https://api.github.com/repos/darrenstahlmsft/containerd/git/trees{/sha}","statuses_url":"https://api.github.com/repos/darrenstahlmsft/containerd/statuses/{sha}","languages_url":"https://api.github.com/repos/darrenstahlmsft/containerd/languages","stargazers_url":"https://api.github.com/repos/darrenstahlmsft/containerd/stargazers","contributors_url":"https://api.github.com/repos/darrenstahlmsft/containerd/contributors","subscribers_url":"https://api.github.com/repos/darrenstahlmsft/containerd/subscribers","subscription_url":"https://api.github.com/repos/darrenstahlmsft/containerd/subscription","commits_url":"https://api.github.com/repos/darrenstahlmsft/containerd/commits{/sha}","git_commits_url":"https://api.github.com/repos/darrenstahlmsft/containerd/git/commits{/sha}","comments_url":"https://api.github.com/repos/darrenstahlmsft/containerd/comments{/number}","issue_comment_url":"https://api.github.com/repos/darrenstahlmsft/containerd/issues/comments{/number}","contents_url":"https://api.github.com/repos/darrenstahlmsft/containerd/contents/{+path}","compare_url":"https://api.github.com/repos/darrenstahlmsft/containerd/compare/{base}...{head}","merges_url":"https://api.github.com/repos/darrenstahlmsft/containerd/merges","archive_url":"https://api.github.com/repos/darrenstahlmsft/containerd/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/darrenstahlmsft/containerd/downloads","issues_url":"https://api.github.com/repos/darrenstahlmsft/containerd/issues{/number}","pulls_url":"https://api.github.com/repos/darrenstahlmsft/containerd/pulls{/number}","milestones_url":"https://api.github.com/repos/darrenstahlmsft/containerd/milestones{/number}","notifications_url":"https://api.github.com/repos/darrenstahlmsft/containerd/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/darrenstahlmsft/containerd/labels{/name}","releases_url":"https://api.github.com/repos/darrenstahlmsft/containerd/releases{/id}","deployments_url":"https://api.github.com/repos/darrenstahlmsft/containerd/deployments","created_at":"2017-05-22T22:18:27Z","updated_at":"2017-05-22T22:18:29Z","pushed_at":"2018-04-12T01:35:47Z","git_url":"git://github.com/darrenstahlmsft/containerd.git","ssh_url":"git@github.com:darrenstahlmsft/containerd.git","clone_url":"https://github.com/darrenstahlmsft/containerd.git","svn_url":"https://github.com/darrenstahlmsft/containerd","homepage":"https://containerd.io","size":41731,"stargazers_count":0,"watchers_count":0,"language":"Go","has_issues":false,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"archived":false,"open_issues_count":0,"license":{"key":"other","name":"Other","spdx_id":null,"url":null},"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"containerd:master","ref":"master","sha":"7f053943ca70fc587f8fef047a549fdea7c97b9b","user":{"login":"containerd","id":14037953,"avatar_url":"https://avatars1.githubusercontent.com/u/14037953?v=4","gravatar_id":"","url":"https://api.github.com/users/containerd","html_url":"https://github.com/containerd","followers_url":"https://api.github.com/users/containerd/followers","following_url":"https://api.github.com/users/containerd/following{/other_user}","gists_url":"https://api.github.com/users/containerd/gists{/gist_id}","starred_url":"https://api.github.com/users/containerd/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/containerd/subscriptions","organizations_url":"https://api.github.com/users/containerd/orgs","repos_url":"https://api.github.com/users/containerd/repos","events_url":"https://api.github.com/users/containerd/events{/privacy}","received_events_url":"https://api.github.com/users/containerd/received_events","type":"Organization","site_admin":false},"repo":{"id":46089560,"name":"containerd","full_name":"containerd/containerd","owner":{"login":"containerd","id":14037953,"avatar_url":"https://avatars1.githubusercontent.com/u/14037953?v=4","gravatar_id":"","url":"https://api.github.com/users/containerd","html_url":"https://github.com/containerd","followers_url":"https://api.github.com/users/containerd/followers","following_url":"https://api.github.com/users/containerd/following{/other_user}","gists_url":"https://api.github.com/users/containerd/gists{/gist_id}","starred_url":"https://api.github.com/users/containerd/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/containerd/subscriptions","organizations_url":"https://api.github.com/users/containerd/orgs","repos_url":"https://api.github.com/users/containerd/repos","events_url":"https://api.github.com/users/containerd/events{/privacy}","received_events_url":"https://api.github.com/users/containerd/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/containerd/containerd","description":"An open and reliable container runtime","fork":false,"url":"https://api.github.com/repos/containerd/containerd","forks_url":"https://api.github.com/repos/containerd/containerd/forks","keys_url":"https://api.github.com/repos/containerd/containerd/keys{/key_id}","collaborators_url":"https://api.github.com/repos/containerd/containerd/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/containerd/containerd/teams","hooks_url":"https://api.github.com/repos/containerd/containerd/hooks","issue_events_url":"https://api.github.com/repos/containerd/containerd/issues/events{/number}","events_url":"https://api.github.com/repos/containerd/containerd/events","assignees_url":"https://api.github.com/repos/containerd/containerd/assignees{/user}","branches_url":"https://api.github.com/repos/containerd/containerd/branches{/branch}","tags_url":"https://api.github.com/repos/containerd/containerd/tags","blobs_url":"https://api.github.com/repos/containerd/containerd/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/containerd/containerd/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/containerd/containerd/git/refs{/sha}","trees_url":"https://api.github.com/repos/containerd/containerd/git/trees{/sha}","statuses_url":"https://api.github.com/repos/containerd/containerd/statuses/{sha}","languages_url":"https://api.github.com/repos/containerd/containerd/languages","stargazers_url":"https://api.github.com/repos/containerd/containerd/stargazers","contributors_url":"https://api.github.com/repos/containerd/containerd/contributors","subscribers_url":"https://api.github.com/repos/containerd/containerd/subscribers","subscription_url":"https://api.github.com/repos/containerd/containerd/subscription","commits_url":"https://api.github.com/repos/containerd/containerd/commits{/sha}","git_commits_url":"https://api.github.com/repos/containerd/containerd/git/commits{/sha}","comments_url":"https://api.github.com/repos/containerd/containerd/comments{/number}","issue_comment_url":"https://api.github.com/repos/containerd/containerd/issues/comments{/number}","contents_url":"https://api.github.com/repos/containerd/containerd/contents/{+path}","compare_url":"https://api.github.com/repos/containerd/containerd/compare/{base}...{head}","merges_url":"https://api.github.com/repos/containerd/containerd/merges","archive_url":"https://api.github.com/repos/containerd/containerd/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/containerd/containerd/downloads","issues_url":"https://api.github.com/repos/containerd/containerd/issues{/number}","pulls_url":"https://api.github.com/repos/containerd/containerd/pulls{/number}","milestones_url":"https://api.github.com/repos/containerd/containerd/milestones{/number}","notifications_url":"https://api.github.com/repos/containerd/containerd/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/containerd/containerd/labels{/name}","releases_url":"https://api.github.com/repos/containerd/containerd/releases{/id}","deployments_url":"https://api.github.com/repos/containerd/containerd/deployments","created_at":"2015-11-13T00:27:43Z","updated_at":"2018-04-16T14:38:19Z","pushed_at":"2018-04-13T23:12:05Z","git_url":"git://github.com/containerd/containerd.git","ssh_url":"git@github.com:containerd/containerd.git","clone_url":"https://github.com/containerd/containerd.git","svn_url":"https://github.com/containerd/containerd","homepage":"https://containerd.io","size":42117,"stargazers_count":2462,"watchers_count":2462,"language":"Go","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":false,"has_pages":true,"forks_count":499,"mirror_url":null,"archived":false,"open_issues_count":73,"license":{"key":"apache-2.0","name":"Apache License 2.0","spdx_id":"Apache-2.0","url":"https://api.github.com/licenses/apache-2.0"},"forks":499,"open_issues":73,"watchers":2462,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/containerd/containerd/pulls/2287"},"html":{"href":"https://github.com/containerd/containerd/pull/2287"},"issue":{"href":"https://api.github.com/repos/containerd/containerd/issues/2287"},"comments":{"href":"https://api.github.com/repos/containerd/containerd/issues/2287/comments"},"review_comments":{"href":"https://api.github.com/repos/containerd/containerd/pulls/2287/comments"},"review_comment":{"href":"https://api.github.com/repos/containerd/containerd/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/containerd/containerd/pulls/2287/commits"},"statuses":{"href":"https://api.github.com/repos/containerd/containerd/statuses/6be0fdd58eab566017817176a9b588ae2b6449ff"}},"author_association":"CONTRIBUTOR"}}
{"actor":{"display_login":"darrenstahlmsft"}}