{"action":"created","comment":{"url":"https://api.github.com/repos/kubernetes-incubator/cri-o/pulls/comments/179857474","pull_request_review_id":110186013,"id":179857474,"diff_hunk":"@@ -87,15 +87,13 @@ func addOCIBindMounts(mountLabel string, containerConfig *pb.ContainerConfig, sp\n \t\t}\n \t\tsrc := filepath.Join(bindMountPrefix, mount.HostPath)\n \n-\t\tif _, err := os.Lstat(src); err != nil && os.IsNotExist(err) {\n-\t\t\tif err1 := os.MkdirAll(src, 0644); err1 != nil {\n-\t\t\t\treturn nil, nil, fmt.Errorf(\"Failed to mkdir %s: %s\", src, err)\n-\t\t\t}\n-\t\t}\n-\n \t\tsrc, err := resolveSymbolicLink(src, bindMountPrefix)\n \t\tif err != nil {\n-\t\t\treturn nil, nil, fmt.Errorf(\"failed to resolve symlink %q: %v\", src, err)\n+\t\t\tif !os.IsNotExist(err) {\n+\t\t\t\treturn nil, nil, fmt.Errorf(\"failed to resolve symlink %q: %v\", src, err)","path":"server/container_create.go","position":null,"original_position":14,"commit_id":"4386afe82972659b19b5c7d4c786507696f0e7ec","original_commit_id":"911782140a785db0022c45c8880556c3ce7fb6c8","user":{"login":"giuseppe","id":67430,"avatar_url":"https://avatars0.githubusercontent.com/u/67430?v=4","gravatar_id":"","url":"https://api.github.com/users/giuseppe","html_url":"https://github.com/giuseppe","followers_url":"https://api.github.com/users/giuseppe/followers","following_url":"https://api.github.com/users/giuseppe/following{/other_user}","gists_url":"https://api.github.com/users/giuseppe/gists{/gist_id}","starred_url":"https://api.github.com/users/giuseppe/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/giuseppe/subscriptions","organizations_url":"https://api.github.com/users/giuseppe/orgs","repos_url":"https://api.github.com/users/giuseppe/repos","events_url":"https://api.github.com/users/giuseppe/events{/privacy}","received_events_url":"https://api.github.com/users/giuseppe/received_events","type":"User","site_admin":false},"body":"I amended this change.  I left the path=\"\" in the Lstat error case as `symlink.FollowSymlinkInScope` doesn't return the path in the error case so `resolveSymbolicLink` would have two different behaviours depending where it fails","created_at":"2018-04-06T19:42:33Z","updated_at":"2018-04-06T19:42:33Z","html_url":"https://github.com/kubernetes-incubator/cri-o/pull/1485#discussion_r179857474","pull_request_url":"https://api.github.com/repos/kubernetes-incubator/cri-o/pulls/1485","author_association":"CONTRIBUTOR","_links":{"self":{"href":"https://api.github.com/repos/kubernetes-incubator/cri-o/pulls/comments/179857474"},"html":{"href":"https://github.com/kubernetes-incubator/cri-o/pull/1485#discussion_r179857474"},"pull_request":{"href":"https://api.github.com/repos/kubernetes-incubator/cri-o/pulls/1485"}},"in_reply_to_id":179770250},"pull_request":{"url":"https://api.github.com/repos/kubernetes-incubator/cri-o/pulls/1485","id":179135052,"html_url":"https://github.com/kubernetes-incubator/cri-o/pull/1485","diff_url":"https://github.com/kubernetes-incubator/cri-o/pull/1485.diff","patch_url":"https://github.com/kubernetes-incubator/cri-o/pull/1485.patch","issue_url":"https://api.github.com/repos/kubernetes-incubator/cri-o/issues/1485","number":1485,"state":"open","locked":false,"title":"cri-o: allow a prefix for all bind mounts","user":{"login":"giuseppe","id":67430,"avatar_url":"https://avatars0.githubusercontent.com/u/67430?v=4","gravatar_id":"","url":"https://api.github.com/users/giuseppe","html_url":"https://github.com/giuseppe","followers_url":"https://api.github.com/users/giuseppe/followers","following_url":"https://api.github.com/users/giuseppe/following{/other_user}","gists_url":"https://api.github.com/users/giuseppe/gists{/gist_id}","starred_url":"https://api.github.com/users/giuseppe/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/giuseppe/subscriptions","organizations_url":"https://api.github.com/users/giuseppe/orgs","repos_url":"https://api.github.com/users/giuseppe/repos","events_url":"https://api.github.com/users/giuseppe/events{/privacy}","received_events_url":"https://api.github.com/users/giuseppe/received_events","type":"User","site_admin":false},"body":"Introduce a new config --bind-mount-prefix=PREFIX that adds a prefix\r\nto the source for every bind mount.  This allows CRI-O to run inside\r\nof a container, and be able to see the host rootfs.\r\n\r\nSigned-off-by: Giuseppe Scrivano <gscrivan@redhat.com>\r\n\r\n**- What I did**\r\nAdded a new option --bind-mount-prefix=PREFIX to specify a prefix for every bind mount.\r\n\r\n**- How I did it**\r\nIf a bind mount PREFIX is specified, the source for each bind mount is prefixed with it\r\n\r\n**- How to verify it**\r\n`# mkdir -p /host/foo`\r\n`# touch /host/foo/bar`\r\n`# crio --bind-mount-prefix=/host/host`\r\n\r\nA mount from `/foo/bar` -> `/bar` is converted to `/host/foo/bar` -> `/bar`\r\n\r\n**- Description for the changelog**\r\nNew option --bind-mount-prefix=PREFIX to permit CRI-O in a container to get full access to the host rootfs\r\n\r\nMarked as WIP as I am still testing it","created_at":"2018-04-03T15:26:40Z","updated_at":"2018-04-06T19:42:33Z","closed_at":null,"merged_at":null,"merge_commit_sha":"dc01cee5104f2406289eb059152cc61bbcea4805","assignee":null,"assignees":[],"requested_reviewers":[{"login":"mrunalp","id":53798,"avatar_url":"https://avatars1.githubusercontent.com/u/53798?v=4","gravatar_id":"","url":"https://api.github.com/users/mrunalp","html_url":"https://github.com/mrunalp","followers_url":"https://api.github.com/users/mrunalp/followers","following_url":"https://api.github.com/users/mrunalp/following{/other_user}","gists_url":"https://api.github.com/users/mrunalp/gists{/gist_id}","starred_url":"https://api.github.com/users/mrunalp/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mrunalp/subscriptions","organizations_url":"https://api.github.com/users/mrunalp/orgs","repos_url":"https://api.github.com/users/mrunalp/repos","events_url":"https://api.github.com/users/mrunalp/events{/privacy}","received_events_url":"https://api.github.com/users/mrunalp/received_events","type":"User","site_admin":false},{"login":"runcom","id":849915,"avatar_url":"https://avatars2.githubusercontent.com/u/849915?v=4","gravatar_id":"","url":"https://api.github.com/users/runcom","html_url":"https://github.com/runcom","followers_url":"https://api.github.com/users/runcom/followers","following_url":"https://api.github.com/users/runcom/following{/other_user}","gists_url":"https://api.github.com/users/runcom/gists{/gist_id}","starred_url":"https://api.github.com/users/runcom/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/runcom/subscriptions","organizations_url":"https://api.github.com/users/runcom/orgs","repos_url":"https://api.github.com/users/runcom/repos","events_url":"https://api.github.com/users/runcom/events{/privacy}","received_events_url":"https://api.github.com/users/runcom/received_events","type":"User","site_admin":false}],"requested_teams":[],"labels":[{"id":484626496,"url":"https://api.github.com/repos/kubernetes-incubator/cri-o/labels/cncf-cla:%20yes","name":"cncf-cla: yes","color":"ededed","default":false},{"id":677262217,"url":"https://api.github.com/repos/kubernetes-incubator/cri-o/labels/size/M","name":"size/M","color":"ededed","default":false}],"milestone":null,"commits_url":"https://api.github.com/repos/kubernetes-incubator/cri-o/pulls/1485/commits","review_comments_url":"https://api.github.com/repos/kubernetes-incubator/cri-o/pulls/1485/comments","review_comment_url":"https://api.github.com/repos/kubernetes-incubator/cri-o/pulls/comments{/number}","comments_url":"https://api.github.com/repos/kubernetes-incubator/cri-o/issues/1485/comments","statuses_url":"https://api.github.com/repos/kubernetes-incubator/cri-o/statuses/4386afe82972659b19b5c7d4c786507696f0e7ec","head":{"label":"giuseppe:bind-mount-prefix","ref":"bind-mount-prefix","sha":"4386afe82972659b19b5c7d4c786507696f0e7ec","user":{"login":"giuseppe","id":67430,"avatar_url":"https://avatars0.githubusercontent.com/u/67430?v=4","gravatar_id":"","url":"https://api.github.com/users/giuseppe","html_url":"https://github.com/giuseppe","followers_url":"https://api.github.com/users/giuseppe/followers","following_url":"https://api.github.com/users/giuseppe/following{/other_user}","gists_url":"https://api.github.com/users/giuseppe/gists{/gist_id}","starred_url":"https://api.github.com/users/giuseppe/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/giuseppe/subscriptions","organizations_url":"https://api.github.com/users/giuseppe/orgs","repos_url":"https://api.github.com/users/giuseppe/repos","events_url":"https://api.github.com/users/giuseppe/events{/privacy}","received_events_url":"https://api.github.com/users/giuseppe/received_events","type":"User","site_admin":false},"repo":{"id":97211068,"name":"cri-o","full_name":"giuseppe/cri-o","owner":{"login":"giuseppe","id":67430,"avatar_url":"https://avatars0.githubusercontent.com/u/67430?v=4","gravatar_id":"","url":"https://api.github.com/users/giuseppe","html_url":"https://github.com/giuseppe","followers_url":"https://api.github.com/users/giuseppe/followers","following_url":"https://api.github.com/users/giuseppe/following{/other_user}","gists_url":"https://api.github.com/users/giuseppe/gists{/gist_id}","starred_url":"https://api.github.com/users/giuseppe/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/giuseppe/subscriptions","organizations_url":"https://api.github.com/users/giuseppe/orgs","repos_url":"https://api.github.com/users/giuseppe/repos","events_url":"https://api.github.com/users/giuseppe/events{/privacy}","received_events_url":"https://api.github.com/users/giuseppe/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/giuseppe/cri-o","description":"Open Container Initiative-based implementation of Kubernetes Container Runtime Interface","fork":true,"url":"https://api.github.com/repos/giuseppe/cri-o","forks_url":"https://api.github.com/repos/giuseppe/cri-o/forks","keys_url":"https://api.github.com/repos/giuseppe/cri-o/keys{/key_id}","collaborators_url":"https://api.github.com/repos/giuseppe/cri-o/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/giuseppe/cri-o/teams","hooks_url":"https://api.github.com/repos/giuseppe/cri-o/hooks","issue_events_url":"https://api.github.com/repos/giuseppe/cri-o/issues/events{/number}","events_url":"https://api.github.com/repos/giuseppe/cri-o/events","assignees_url":"https://api.github.com/repos/giuseppe/cri-o/assignees{/user}","branches_url":"https://api.github.com/repos/giuseppe/cri-o/branches{/branch}","tags_url":"https://api.github.com/repos/giuseppe/cri-o/tags","blobs_url":"https://api.github.com/repos/giuseppe/cri-o/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/giuseppe/cri-o/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/giuseppe/cri-o/git/refs{/sha}","trees_url":"https://api.github.com/repos/giuseppe/cri-o/git/trees{/sha}","statuses_url":"https://api.github.com/repos/giuseppe/cri-o/statuses/{sha}","languages_url":"https://api.github.com/repos/giuseppe/cri-o/languages","stargazers_url":"https://api.github.com/repos/giuseppe/cri-o/stargazers","contributors_url":"https://api.github.com/repos/giuseppe/cri-o/contributors","subscribers_url":"https://api.github.com/repos/giuseppe/cri-o/subscribers","subscription_url":"https://api.github.com/repos/giuseppe/cri-o/subscription","commits_url":"https://api.github.com/repos/giuseppe/cri-o/commits{/sha}","git_commits_url":"https://api.github.com/repos/giuseppe/cri-o/git/commits{/sha}","comments_url":"https://api.github.com/repos/giuseppe/cri-o/comments{/number}","issue_comment_url":"https://api.github.com/repos/giuseppe/cri-o/issues/comments{/number}","contents_url":"https://api.github.com/repos/giuseppe/cri-o/contents/{+path}","compare_url":"https://api.github.com/repos/giuseppe/cri-o/compare/{base}...{head}","merges_url":"https://api.github.com/repos/giuseppe/cri-o/merges","archive_url":"https://api.github.com/repos/giuseppe/cri-o/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/giuseppe/cri-o/downloads","issues_url":"https://api.github.com/repos/giuseppe/cri-o/issues{/number}","pulls_url":"https://api.github.com/repos/giuseppe/cri-o/pulls{/number}","milestones_url":"https://api.github.com/repos/giuseppe/cri-o/milestones{/number}","notifications_url":"https://api.github.com/repos/giuseppe/cri-o/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/giuseppe/cri-o/labels{/name}","releases_url":"https://api.github.com/repos/giuseppe/cri-o/releases{/id}","deployments_url":"https://api.github.com/repos/giuseppe/cri-o/deployments","created_at":"2017-07-14T08:22:39Z","updated_at":"2017-07-14T08:22:41Z","pushed_at":"2018-04-06T19:41:31Z","git_url":"git://github.com/giuseppe/cri-o.git","ssh_url":"git@github.com:giuseppe/cri-o.git","clone_url":"https://github.com/giuseppe/cri-o.git","svn_url":"https://github.com/giuseppe/cri-o","homepage":"","size":41484,"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":null,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"kubernetes-incubator:master","ref":"master","sha":"86b61d44cfe7de0f4095877d303c4d1b3aa2ec06","user":{"login":"kubernetes-incubator","id":20862812,"avatar_url":"https://avatars2.githubusercontent.com/u/20862812?v=4","gravatar_id":"","url":"https://api.github.com/users/kubernetes-incubator","html_url":"https://github.com/kubernetes-incubator","followers_url":"https://api.github.com/users/kubernetes-incubator/followers","following_url":"https://api.github.com/users/kubernetes-incubator/following{/other_user}","gists_url":"https://api.github.com/users/kubernetes-incubator/gists{/gist_id}","starred_url":"https://api.github.com/users/kubernetes-incubator/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kubernetes-incubator/subscriptions","organizations_url":"https://api.github.com/users/kubernetes-incubator/orgs","repos_url":"https://api.github.com/users/kubernetes-incubator/repos","events_url":"https://api.github.com/users/kubernetes-incubator/events{/privacy}","received_events_url":"https://api.github.com/users/kubernetes-incubator/received_events","type":"Organization","site_admin":false},"repo":{"id":67828134,"name":"cri-o","full_name":"kubernetes-incubator/cri-o","owner":{"login":"kubernetes-incubator","id":20862812,"avatar_url":"https://avatars2.githubusercontent.com/u/20862812?v=4","gravatar_id":"","url":"https://api.github.com/users/kubernetes-incubator","html_url":"https://github.com/kubernetes-incubator","followers_url":"https://api.github.com/users/kubernetes-incubator/followers","following_url":"https://api.github.com/users/kubernetes-incubator/following{/other_user}","gists_url":"https://api.github.com/users/kubernetes-incubator/gists{/gist_id}","starred_url":"https://api.github.com/users/kubernetes-incubator/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kubernetes-incubator/subscriptions","organizations_url":"https://api.github.com/users/kubernetes-incubator/orgs","repos_url":"https://api.github.com/users/kubernetes-incubator/repos","events_url":"https://api.github.com/users/kubernetes-incubator/events{/privacy}","received_events_url":"https://api.github.com/users/kubernetes-incubator/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/kubernetes-incubator/cri-o","description":"Open Container Initiative-based implementation of Kubernetes Container Runtime Interface","fork":false,"url":"https://api.github.com/repos/kubernetes-incubator/cri-o","forks_url":"https://api.github.com/repos/kubernetes-incubator/cri-o/forks","keys_url":"https://api.github.com/repos/kubernetes-incubator/cri-o/keys{/key_id}","collaborators_url":"https://api.github.com/repos/kubernetes-incubator/cri-o/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/kubernetes-incubator/cri-o/teams","hooks_url":"https://api.github.com/repos/kubernetes-incubator/cri-o/hooks","issue_events_url":"https://api.github.com/repos/kubernetes-incubator/cri-o/issues/events{/number}","events_url":"https://api.github.com/repos/kubernetes-incubator/cri-o/events","assignees_url":"https://api.github.com/repos/kubernetes-incubator/cri-o/assignees{/user}","branches_url":"https://api.github.com/repos/kubernetes-incubator/cri-o/branches{/branch}","tags_url":"https://api.github.com/repos/kubernetes-incubator/cri-o/tags","blobs_url":"https://api.github.com/repos/kubernetes-incubator/cri-o/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/kubernetes-incubator/cri-o/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/kubernetes-incubator/cri-o/git/refs{/sha}","trees_url":"https://api.github.com/repos/kubernetes-incubator/cri-o/git/trees{/sha}","statuses_url":"https://api.github.com/repos/kubernetes-incubator/cri-o/statuses/{sha}","languages_url":"https://api.github.com/repos/kubernetes-incubator/cri-o/languages","stargazers_url":"https://api.github.com/repos/kubernetes-incubator/cri-o/stargazers","contributors_url":"https://api.github.com/repos/kubernetes-incubator/cri-o/contributors","subscribers_url":"https://api.github.com/repos/kubernetes-incubator/cri-o/subscribers","subscription_url":"https://api.github.com/repos/kubernetes-incubator/cri-o/subscription","commits_url":"https://api.github.com/repos/kubernetes-incubator/cri-o/commits{/sha}","git_commits_url":"https://api.github.com/repos/kubernetes-incubator/cri-o/git/commits{/sha}","comments_url":"https://api.github.com/repos/kubernetes-incubator/cri-o/comments{/number}","issue_comment_url":"https://api.github.com/repos/kubernetes-incubator/cri-o/issues/comments{/number}","contents_url":"https://api.github.com/repos/kubernetes-incubator/cri-o/contents/{+path}","compare_url":"https://api.github.com/repos/kubernetes-incubator/cri-o/compare/{base}...{head}","merges_url":"https://api.github.com/repos/kubernetes-incubator/cri-o/merges","archive_url":"https://api.github.com/repos/kubernetes-incubator/cri-o/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/kubernetes-incubator/cri-o/downloads","issues_url":"https://api.github.com/repos/kubernetes-incubator/cri-o/issues{/number}","pulls_url":"https://api.github.com/repos/kubernetes-incubator/cri-o/pulls{/number}","milestones_url":"https://api.github.com/repos/kubernetes-incubator/cri-o/milestones{/number}","notifications_url":"https://api.github.com/repos/kubernetes-incubator/cri-o/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/kubernetes-incubator/cri-o/labels{/name}","releases_url":"https://api.github.com/repos/kubernetes-incubator/cri-o/releases{/id}","deployments_url":"https://api.github.com/repos/kubernetes-incubator/cri-o/deployments","created_at":"2016-09-09T19:56:31Z","updated_at":"2018-04-06T15:31:01Z","pushed_at":"2018-04-06T19:41:33Z","git_url":"git://github.com/kubernetes-incubator/cri-o.git","ssh_url":"git@github.com:kubernetes-incubator/cri-o.git","clone_url":"https://github.com/kubernetes-incubator/cri-o.git","svn_url":"https://github.com/kubernetes-incubator/cri-o","homepage":"","size":42032,"stargazers_count":1007,"watchers_count":1007,"language":"Go","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":196,"mirror_url":null,"archived":false,"open_issues_count":69,"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":196,"open_issues":69,"watchers":1007,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/kubernetes-incubator/cri-o/pulls/1485"},"html":{"href":"https://github.com/kubernetes-incubator/cri-o/pull/1485"},"issue":{"href":"https://api.github.com/repos/kubernetes-incubator/cri-o/issues/1485"},"comments":{"href":"https://api.github.com/repos/kubernetes-incubator/cri-o/issues/1485/comments"},"review_comments":{"href":"https://api.github.com/repos/kubernetes-incubator/cri-o/pulls/1485/comments"},"review_comment":{"href":"https://api.github.com/repos/kubernetes-incubator/cri-o/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/kubernetes-incubator/cri-o/pulls/1485/commits"},"statuses":{"href":"https://api.github.com/repos/kubernetes-incubator/cri-o/statuses/4386afe82972659b19b5c7d4c786507696f0e7ec"}},"author_association":"CONTRIBUTOR"}}
{"actor":{"display_login":"giuseppe"}}