{"action":"created","comment":{"url":"https://api.github.com/repos/containers/libpod/pulls/comments/211655014","pull_request_review_id":148122789,"id":211655014,"node_id":"MDI0OlB1bGxSZXF1ZXN0UmV2aWV3Q29tbWVudDIxMTY1NTAxNA==","diff_hunk":"@@ -87,45 +87,58 @@ func (r *Runtime) NewPod(options ...PodCreateOption) (*Pod, error) {\n \tif pod.config.UsePodCgroup {\n \t\tlogrus.Debugf(\"Got pod cgroup as %s\", pod.state.CgroupPath)\n \t}\n+\tif pod.HasInfraContainer() != pod.SharesNamespaces() {\n+\t\treturn nil, errors.Errorf(\"Pods must have an infra container to share namespaces\")\n+\t}\n \n \tif err := r.state.AddPod(pod); err != nil {\n \t\treturn nil, errors.Wrapf(err, \"error adding pod to state\")\n \t}\n \n+\tif pod.HasInfraContainer() {\n+\t\tctr, err := r.createInfraContainer(ctx, pod)\n+\t\tif err != nil {\n+\t\t\t// Tear down pod, as it is assumed a the pod will contain\n+\t\t\t// a pause container, and it does not.\n+\t\t\tif err2 := r.removePod(ctx, pod, true, true); err2 != nil {\n+\t\t\t\tlogrus.Errorf(\"Error removing pod after pause container creation failure: %v\", err2)\n+\t\t\t}\n+\t\t\treturn nil, errors.Wrapf(err, \"error adding Infra Container\")\n+\t\t}\n+\t\tpod.state.InfraContainerID = ctr.ID()\n+\t\tif err := pod.save(); err != nil {\n+\t\t\treturn nil, err\n+\t\t}\n+\t}\n+\n \treturn pod, nil\n }\n \n func (r *Runtime) removePod(ctx context.Context, p *Pod, removeCtrs, force bool) error {\n-\tr.lock.Lock()\n-\tdefer r.lock.Unlock()\n-\n-\tif !r.valid {\n-\t\treturn ErrRuntimeStopped\n-\t}\n-\n \tif !p.valid {","path":"libpod/runtime_pod_linux.go","position":48,"original_position":48,"commit_id":"9bd8dee8cb42db9af5a3499344c295ed067d6671","original_commit_id":"9bd8dee8cb42db9af5a3499344c295ed067d6671","user":{"login":"haircommander","id":9082919,"node_id":"MDQ6VXNlcjkwODI5MTk=","avatar_url":"https://avatars0.githubusercontent.com/u/9082919?v=4","gravatar_id":"","url":"https://api.github.com/users/haircommander","html_url":"https://github.com/haircommander","followers_url":"https://api.github.com/users/haircommander/followers","following_url":"https://api.github.com/users/haircommander/following{/other_user}","gists_url":"https://api.github.com/users/haircommander/gists{/gist_id}","starred_url":"https://api.github.com/users/haircommander/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/haircommander/subscriptions","organizations_url":"https://api.github.com/users/haircommander/orgs","repos_url":"https://api.github.com/users/haircommander/repos","events_url":"https://api.github.com/users/haircommander/events{/privacy}","received_events_url":"https://api.github.com/users/haircommander/received_events","type":"User","site_admin":false},"body":"SGTM","created_at":"2018-08-21T15:38:41Z","updated_at":"2018-08-21T15:38:41Z","html_url":"https://github.com/containers/libpod/pull/1187#discussion_r211655014","pull_request_url":"https://api.github.com/repos/containers/libpod/pulls/1187","author_association":"COLLABORATOR","_links":{"self":{"href":"https://api.github.com/repos/containers/libpod/pulls/comments/211655014"},"html":{"href":"https://github.com/containers/libpod/pull/1187#discussion_r211655014"},"pull_request":{"href":"https://api.github.com/repos/containers/libpod/pulls/1187"}},"in_reply_to_id":211630063},"pull_request":{"url":"https://api.github.com/repos/containers/libpod/pulls/1187","id":204827219,"node_id":"MDExOlB1bGxSZXF1ZXN0MjA0ODI3MjE5","html_url":"https://github.com/containers/libpod/pull/1187","diff_url":"https://github.com/containers/libpod/pull/1187.diff","patch_url":"https://github.com/containers/libpod/pull/1187.patch","issue_url":"https://api.github.com/repos/containers/libpod/issues/1187","number":1187,"state":"open","locked":false,"title":"Added option to share kernel namespaces in libpod and podman.","user":{"login":"haircommander","id":9082919,"node_id":"MDQ6VXNlcjkwODI5MTk=","avatar_url":"https://avatars0.githubusercontent.com/u/9082919?v=4","gravatar_id":"","url":"https://api.github.com/users/haircommander","html_url":"https://github.com/haircommander","followers_url":"https://api.github.com/users/haircommander/followers","following_url":"https://api.github.com/users/haircommander/following{/other_user}","gists_url":"https://api.github.com/users/haircommander/gists{/gist_id}","starred_url":"https://api.github.com/users/haircommander/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/haircommander/subscriptions","organizations_url":"https://api.github.com/users/haircommander/orgs","repos_url":"https://api.github.com/users/haircommander/repos","events_url":"https://api.github.com/users/haircommander/events{/privacy}","received_events_url":"https://api.github.com/users/haircommander/received_events","type":"User","site_admin":false},"body":"See notes for my current thoughts and confusions. Most notably: \r\nI have had  a decent amount of trouble setting up the pause container. The cyclical dependencies between create config and libpod are turning out to be very difficult to avoid. This patch sets up kernel namespaces based on the first container added to the pod, so it will work in conjunction with the pause container once that is set up.\r\n\r\nI'm iffy on where to set up the container namespaces. I added a hacky work around because it feels like runtime_ctr is a good spot for it, but that involves skipping setting up net namespace in createconfig.\r\n\r\nI also want to find a better name for pause container/podInfracontainer.\r\n\r\nSigned-off-by: haircommander <pehunt@redhat.com>","created_at":"2018-07-30T14:41:02Z","updated_at":"2018-08-21T15:38:41Z","closed_at":null,"merged_at":null,"merge_commit_sha":"d815cda8966ae4912527b5d5514a68a3c89ec186","assignee":null,"assignees":[],"requested_reviewers":[{"login":"rhatdan","id":2000835,"node_id":"MDQ6VXNlcjIwMDA4MzU=","avatar_url":"https://avatars3.githubusercontent.com/u/2000835?v=4","gravatar_id":"","url":"https://api.github.com/users/rhatdan","html_url":"https://github.com/rhatdan","followers_url":"https://api.github.com/users/rhatdan/followers","following_url":"https://api.github.com/users/rhatdan/following{/other_user}","gists_url":"https://api.github.com/users/rhatdan/gists{/gist_id}","starred_url":"https://api.github.com/users/rhatdan/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rhatdan/subscriptions","organizations_url":"https://api.github.com/users/rhatdan/orgs","repos_url":"https://api.github.com/users/rhatdan/repos","events_url":"https://api.github.com/users/rhatdan/events{/privacy}","received_events_url":"https://api.github.com/users/rhatdan/received_events","type":"User","site_admin":false},{"login":"baude","id":8824535,"node_id":"MDQ6VXNlcjg4MjQ1MzU=","avatar_url":"https://avatars3.githubusercontent.com/u/8824535?v=4","gravatar_id":"","url":"https://api.github.com/users/baude","html_url":"https://github.com/baude","followers_url":"https://api.github.com/users/baude/followers","following_url":"https://api.github.com/users/baude/following{/other_user}","gists_url":"https://api.github.com/users/baude/gists{/gist_id}","starred_url":"https://api.github.com/users/baude/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/baude/subscriptions","organizations_url":"https://api.github.com/users/baude/orgs","repos_url":"https://api.github.com/users/baude/repos","events_url":"https://api.github.com/users/baude/events{/privacy}","received_events_url":"https://api.github.com/users/baude/received_events","type":"User","site_admin":false}],"requested_teams":[],"labels":[],"milestone":null,"commits_url":"https://api.github.com/repos/containers/libpod/pulls/1187/commits","review_comments_url":"https://api.github.com/repos/containers/libpod/pulls/1187/comments","review_comment_url":"https://api.github.com/repos/containers/libpod/pulls/comments{/number}","comments_url":"https://api.github.com/repos/containers/libpod/issues/1187/comments","statuses_url":"https://api.github.com/repos/containers/libpod/statuses/9bd8dee8cb42db9af5a3499344c295ed067d6671","head":{"label":"haircommander:pod-net-ipc","ref":"pod-net-ipc","sha":"9bd8dee8cb42db9af5a3499344c295ed067d6671","user":{"login":"haircommander","id":9082919,"node_id":"MDQ6VXNlcjkwODI5MTk=","avatar_url":"https://avatars0.githubusercontent.com/u/9082919?v=4","gravatar_id":"","url":"https://api.github.com/users/haircommander","html_url":"https://github.com/haircommander","followers_url":"https://api.github.com/users/haircommander/followers","following_url":"https://api.github.com/users/haircommander/following{/other_user}","gists_url":"https://api.github.com/users/haircommander/gists{/gist_id}","starred_url":"https://api.github.com/users/haircommander/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/haircommander/subscriptions","organizations_url":"https://api.github.com/users/haircommander/orgs","repos_url":"https://api.github.com/users/haircommander/repos","events_url":"https://api.github.com/users/haircommander/events{/privacy}","received_events_url":"https://api.github.com/users/haircommander/received_events","type":"User","site_admin":false},"repo":{"id":136067380,"node_id":"MDEwOlJlcG9zaXRvcnkxMzYwNjczODA=","name":"libpod","full_name":"haircommander/libpod","owner":{"login":"haircommander","id":9082919,"node_id":"MDQ6VXNlcjkwODI5MTk=","avatar_url":"https://avatars0.githubusercontent.com/u/9082919?v=4","gravatar_id":"","url":"https://api.github.com/users/haircommander","html_url":"https://github.com/haircommander","followers_url":"https://api.github.com/users/haircommander/followers","following_url":"https://api.github.com/users/haircommander/following{/other_user}","gists_url":"https://api.github.com/users/haircommander/gists{/gist_id}","starred_url":"https://api.github.com/users/haircommander/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/haircommander/subscriptions","organizations_url":"https://api.github.com/users/haircommander/orgs","repos_url":"https://api.github.com/users/haircommander/repos","events_url":"https://api.github.com/users/haircommander/events{/privacy}","received_events_url":"https://api.github.com/users/haircommander/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/haircommander/libpod","description":"libpod is a library used to create container pods.","fork":true,"url":"https://api.github.com/repos/haircommander/libpod","forks_url":"https://api.github.com/repos/haircommander/libpod/forks","keys_url":"https://api.github.com/repos/haircommander/libpod/keys{/key_id}","collaborators_url":"https://api.github.com/repos/haircommander/libpod/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/haircommander/libpod/teams","hooks_url":"https://api.github.com/repos/haircommander/libpod/hooks","issue_events_url":"https://api.github.com/repos/haircommander/libpod/issues/events{/number}","events_url":"https://api.github.com/repos/haircommander/libpod/events","assignees_url":"https://api.github.com/repos/haircommander/libpod/assignees{/user}","branches_url":"https://api.github.com/repos/haircommander/libpod/branches{/branch}","tags_url":"https://api.github.com/repos/haircommander/libpod/tags","blobs_url":"https://api.github.com/repos/haircommander/libpod/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/haircommander/libpod/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/haircommander/libpod/git/refs{/sha}","trees_url":"https://api.github.com/repos/haircommander/libpod/git/trees{/sha}","statuses_url":"https://api.github.com/repos/haircommander/libpod/statuses/{sha}","languages_url":"https://api.github.com/repos/haircommander/libpod/languages","stargazers_url":"https://api.github.com/repos/haircommander/libpod/stargazers","contributors_url":"https://api.github.com/repos/haircommander/libpod/contributors","subscribers_url":"https://api.github.com/repos/haircommander/libpod/subscribers","subscription_url":"https://api.github.com/repos/haircommander/libpod/subscription","commits_url":"https://api.github.com/repos/haircommander/libpod/commits{/sha}","git_commits_url":"https://api.github.com/repos/haircommander/libpod/git/commits{/sha}","comments_url":"https://api.github.com/repos/haircommander/libpod/comments{/number}","issue_comment_url":"https://api.github.com/repos/haircommander/libpod/issues/comments{/number}","contents_url":"https://api.github.com/repos/haircommander/libpod/contents/{+path}","compare_url":"https://api.github.com/repos/haircommander/libpod/compare/{base}...{head}","merges_url":"https://api.github.com/repos/haircommander/libpod/merges","archive_url":"https://api.github.com/repos/haircommander/libpod/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/haircommander/libpod/downloads","issues_url":"https://api.github.com/repos/haircommander/libpod/issues{/number}","pulls_url":"https://api.github.com/repos/haircommander/libpod/pulls{/number}","milestones_url":"https://api.github.com/repos/haircommander/libpod/milestones{/number}","notifications_url":"https://api.github.com/repos/haircommander/libpod/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/haircommander/libpod/labels{/name}","releases_url":"https://api.github.com/repos/haircommander/libpod/releases{/id}","deployments_url":"https://api.github.com/repos/haircommander/libpod/deployments","created_at":"2018-06-04T18:35:36Z","updated_at":"2018-08-21T15:19:14Z","pushed_at":"2018-08-21T15:19:10Z","git_url":"git://github.com/haircommander/libpod.git","ssh_url":"git@github.com:haircommander/libpod.git","clone_url":"https://github.com/haircommander/libpod.git","svn_url":"https://github.com/haircommander/libpod","homepage":null,"size":14997,"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":"apache-2.0","name":"Apache License 2.0","spdx_id":"Apache-2.0","url":"https://api.github.com/licenses/apache-2.0","node_id":"MDc6TGljZW5zZTI="},"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"containers:master","ref":"master","sha":"57e1600315c3b4657797d2605cc69d7343da034f","user":{"login":"containers","id":5874934,"node_id":"MDEyOk9yZ2FuaXphdGlvbjU4NzQ5MzQ=","avatar_url":"https://avatars3.githubusercontent.com/u/5874934?v=4","gravatar_id":"","url":"https://api.github.com/users/containers","html_url":"https://github.com/containers","followers_url":"https://api.github.com/users/containers/followers","following_url":"https://api.github.com/users/containers/following{/other_user}","gists_url":"https://api.github.com/users/containers/gists{/gist_id}","starred_url":"https://api.github.com/users/containers/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/containers/subscriptions","organizations_url":"https://api.github.com/users/containers/orgs","repos_url":"https://api.github.com/users/containers/repos","events_url":"https://api.github.com/users/containers/events{/privacy}","received_events_url":"https://api.github.com/users/containers/received_events","type":"Organization","site_admin":false},"repo":{"id":109145553,"node_id":"MDEwOlJlcG9zaXRvcnkxMDkxNDU1NTM=","name":"libpod","full_name":"containers/libpod","owner":{"login":"containers","id":5874934,"node_id":"MDEyOk9yZ2FuaXphdGlvbjU4NzQ5MzQ=","avatar_url":"https://avatars3.githubusercontent.com/u/5874934?v=4","gravatar_id":"","url":"https://api.github.com/users/containers","html_url":"https://github.com/containers","followers_url":"https://api.github.com/users/containers/followers","following_url":"https://api.github.com/users/containers/following{/other_user}","gists_url":"https://api.github.com/users/containers/gists{/gist_id}","starred_url":"https://api.github.com/users/containers/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/containers/subscriptions","organizations_url":"https://api.github.com/users/containers/orgs","repos_url":"https://api.github.com/users/containers/repos","events_url":"https://api.github.com/users/containers/events{/privacy}","received_events_url":"https://api.github.com/users/containers/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/containers/libpod","description":"libpod is a library used to create container pods.","fork":false,"url":"https://api.github.com/repos/containers/libpod","forks_url":"https://api.github.com/repos/containers/libpod/forks","keys_url":"https://api.github.com/repos/containers/libpod/keys{/key_id}","collaborators_url":"https://api.github.com/repos/containers/libpod/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/containers/libpod/teams","hooks_url":"https://api.github.com/repos/containers/libpod/hooks","issue_events_url":"https://api.github.com/repos/containers/libpod/issues/events{/number}","events_url":"https://api.github.com/repos/containers/libpod/events","assignees_url":"https://api.github.com/repos/containers/libpod/assignees{/user}","branches_url":"https://api.github.com/repos/containers/libpod/branches{/branch}","tags_url":"https://api.github.com/repos/containers/libpod/tags","blobs_url":"https://api.github.com/repos/containers/libpod/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/containers/libpod/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/containers/libpod/git/refs{/sha}","trees_url":"https://api.github.com/repos/containers/libpod/git/trees{/sha}","statuses_url":"https://api.github.com/repos/containers/libpod/statuses/{sha}","languages_url":"https://api.github.com/repos/containers/libpod/languages","stargazers_url":"https://api.github.com/repos/containers/libpod/stargazers","contributors_url":"https://api.github.com/repos/containers/libpod/contributors","subscribers_url":"https://api.github.com/repos/containers/libpod/subscribers","subscription_url":"https://api.github.com/repos/containers/libpod/subscription","commits_url":"https://api.github.com/repos/containers/libpod/commits{/sha}","git_commits_url":"https://api.github.com/repos/containers/libpod/git/commits{/sha}","comments_url":"https://api.github.com/repos/containers/libpod/comments{/number}","issue_comment_url":"https://api.github.com/repos/containers/libpod/issues/comments{/number}","contents_url":"https://api.github.com/repos/containers/libpod/contents/{+path}","compare_url":"https://api.github.com/repos/containers/libpod/compare/{base}...{head}","merges_url":"https://api.github.com/repos/containers/libpod/merges","archive_url":"https://api.github.com/repos/containers/libpod/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/containers/libpod/downloads","issues_url":"https://api.github.com/repos/containers/libpod/issues{/number}","pulls_url":"https://api.github.com/repos/containers/libpod/pulls{/number}","milestones_url":"https://api.github.com/repos/containers/libpod/milestones{/number}","notifications_url":"https://api.github.com/repos/containers/libpod/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/containers/libpod/labels{/name}","releases_url":"https://api.github.com/repos/containers/libpod/releases{/id}","deployments_url":"https://api.github.com/repos/containers/libpod/deployments","created_at":"2017-11-01T15:01:27Z","updated_at":"2018-08-21T14:57:36Z","pushed_at":"2018-08-21T15:37:41Z","git_url":"git://github.com/containers/libpod.git","ssh_url":"git@github.com:containers/libpod.git","clone_url":"https://github.com/containers/libpod.git","svn_url":"https://github.com/containers/libpod","homepage":null,"size":14880,"stargazers_count":231,"watchers_count":231,"language":"Go","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":68,"mirror_url":null,"archived":false,"open_issues_count":59,"license":{"key":"apache-2.0","name":"Apache License 2.0","spdx_id":"Apache-2.0","url":"https://api.github.com/licenses/apache-2.0","node_id":"MDc6TGljZW5zZTI="},"forks":68,"open_issues":59,"watchers":231,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/containers/libpod/pulls/1187"},"html":{"href":"https://github.com/containers/libpod/pull/1187"},"issue":{"href":"https://api.github.com/repos/containers/libpod/issues/1187"},"comments":{"href":"https://api.github.com/repos/containers/libpod/issues/1187/comments"},"review_comments":{"href":"https://api.github.com/repos/containers/libpod/pulls/1187/comments"},"review_comment":{"href":"https://api.github.com/repos/containers/libpod/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/containers/libpod/pulls/1187/commits"},"statuses":{"href":"https://api.github.com/repos/containers/libpod/statuses/9bd8dee8cb42db9af5a3499344c295ed067d6671"}},"author_association":"COLLABORATOR"}}
{"actor":{"display_login":"haircommander"}}