{"action":"created","comment":{"url":"https://api.github.com/repos/yujuhong/kubernetes/pulls/comments/63440003","id":63440003,"diff_hunk":"@@ -0,0 +1,296 @@\n+/*\n+Copyright 2016 The Kubernetes Authors All rights reserved.\n+\n+Licensed under the Apache License, Version 2.0 (the \"License\");\n+you may not use this file except in compliance with the License.\n+You may obtain a copy of the License at\n+\n+    http://www.apache.org/licenses/LICENSE-2.0\n+\n+Unless required by applicable law or agreed to in writing, software\n+distributed under the License is distributed on an \"AS IS\" BASIS,\n+WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n+See the License for the specific language governing permissions and\n+limitations under the License.\n+*/\n+\n+package container\n+\n+import (\n+\t\"io\"\n+\n+\t\"k8s.io/kubernetes/pkg/api\"\n+)\n+\n+// SandboxManager provides basic operations to create/delete and examine the\n+// Sandboxes.\n+type SandboxManager interface {\n+\t// Create creates a sandbox based on the given config, and returns the ID\n+\t// of the new sandbox.\n+\tCreate(config *SandboxConfig) (string, error)\n+\t// Delete deletes the sandbox with by its ID. If there are any running\n+\t// containers in the sandbox, they will be terminated as a side-effect.\n+\tDelete(id string) (string, error)\n+\t// List lists existing sandboxes, filtered by the given SandboxFilter.\n+\tList(filter SandboxFilter) []SandboxListItem\n+\t// Inspect gets the detailed config and status of the sandbox by ID.\n+\tInspect(id string) Sandbox\n+}\n+\n+// SandboxConfig holds all the required and optional fields for creating a\n+// sandbox.\n+type SandboxConfig struct {\n+\t// Name is the name of the sandbox.\n+\tName string\n+\t// Hostname is the hostname of the sandbox.\n+\tHostname string\n+\t// DNSOptions the DNS configuration the sandbox.\n+\tDNSOptions *DNSOptions\n+\t// PortMappings lists the port mappings for the sandbox.\n+\tPortMappings []PortMapping\n+\t// Mounts list the mounts to be added to the sandbox's filesystem.\n+\tMounts []Mount\n+\t// Resources specifies the resource requirements for the sandbox.\n+\tResources *Resources\n+\t// Annotations is an unstructured key value map that may be set by external\n+\t// tools to store and retrieve arbitrary metadata.\n+\tAnnotations map[string]string\n+\t// Linux contains configurations specific to Linux containers.\n+\tLinux *LinuxSandboxConfig\n+}\n+\n+// LinuxSandboxConfig holds platform-specific configuraions for Linux\n+// containers.\n+type LinuxSandboxConfig struct {\n+\t// CgroupParent is the parent cgroup of the sandbox.\n+\tCgroupParent string\n+\t// NamespaceOptions contains configurations for the sanbox's namespaces.\n+\tNamespaceOptions NamespaceOptions\n+\t// SELinux is the SELinux context to be applied to all containers.\n+\tSELinux *api.SELinuxOptions\n+}\n+\n+// NamespaceOptions provides options for Linux namespaces.\n+type NamespaceOptions struct {\n+\t// HostNetwork uses the host's network namespace.\n+\tHostNetwork bool\n+\t// HostPID uses the host's pid namesapce.\n+\tHostPID bool\n+\t// HostIPC uses the host's ipc namespace.\n+\tHostIPC bool\n+}\n+\n+// DNSOptions specifies the DNS servers and search domains.\n+type DNSOptions struct {\n+\t// Servers is a list of DNS servers of the cluster.\n+\tServers []string\n+\t// Searches is a list of DNS search domains of the cluster.\n+\tSearchs []string\n+}\n+\n+type SandboxState string\n+\n+const (\n+\t// SandboxActive means the sandbox is functioning properly.\n+\tSandboxActive SandboxState = \"active\"\n+\t// SandboxInactive means the sandbox is not functioning properly.\n+\tSandboxInactive SandboxState = \"inactive\"\n+)\n+\n+// SandboxFilter is used to filter a list of Sandboxes.\n+type SandboxFilter struct {\n+\t// Name of the sandbox.\n+\tName string\n+\t// ID of the sandbox.\n+\tID string\n+\t// State of the sandbox.\n+\tState string\n+\t// Annotations of the sandbox. A container needs to have all listed\n+\t// annotations to be sandbox a match.\n+\tAnnotations map[string]string\n+}\n+\n+// SandboxListItem contains minimal information about a sandbox.\n+type SandboxListItem struct {\n+\tID    string\n+\tState SandboxState\n+}\n+\n+// Sandbox provides isolation with resource requirements in which containers\n+// can be run.\n+type Sandbox struct {\n+\t// ID of the sandbox.\n+\tID string\n+\t// Config of the sandbox used to create the sandbox.\n+\tConfig SandboxConfig\n+\t// Status of the sandbox.\n+\tStatus SandboxStatus\n+}\n+\n+// SandboxStatus contains the status of the sandbox.\n+type SandboxStatus struct {\n+\t// State of the sandbox.\n+\tState SandboxState\n+\t// Network contains network status if network is handled by the runtime.\n+\tNetwork *SandboxNetworkStatus\n+\t// Status specific to a Linux sandbox.\n+\tLinux *LinuxSandboxStatus\n+}\n+\n+type SandboxNetworkStatus struct {\n+\tIP string\n+}\n+\n+// Namespaces contains paths to the namespaces.\n+type Namespaces struct {\n+\t// Network is the path to the network namespace.\n+\tNetwork string\n+}\n+\n+// LinuxSandBoxStatus contains status specific to Linux sandboxes.\n+type LinuxSandboxStatus struct {\n+\t// Namespaces contains paths to the sandbox's namespaces.\n+\tNamespaces *Namespaces\n+}\n+\n+// Resources contains the CPU/memory resource requirements.\n+type Resources struct {\n+\t// CPU resource requirement.\n+\tCPU api.ResourceRequirements","path":"pkg/kubelet/container/interface.go","position":159,"original_position":159,"commit_id":"ddd041c68ca94d95fa591dce703932fe5d577dd0","original_commit_id":"ddd041c68ca94d95fa591dce703932fe5d577dd0","user":{"login":"vishh","id":7063592,"avatar_url":"https://avatars.githubusercontent.com/u/7063592?v=3","gravatar_id":"","url":"https://api.github.com/users/vishh","html_url":"https://github.com/vishh","followers_url":"https://api.github.com/users/vishh/followers","following_url":"https://api.github.com/users/vishh/following{/other_user}","gists_url":"https://api.github.com/users/vishh/gists{/gist_id}","starred_url":"https://api.github.com/users/vishh/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/vishh/subscriptions","organizations_url":"https://api.github.com/users/vishh/orgs","repos_url":"https://api.github.com/users/vishh/repos","events_url":"https://api.github.com/users/vishh/events{/privacy}","received_events_url":"https://api.github.com/users/vishh/received_events","type":"User","site_admin":false},"body":"Should we instead pass CPU quota and CPU shares?","created_at":"2016-05-16T22:56:38Z","updated_at":"2016-05-16T22:56:38Z","html_url":"https://github.com/yujuhong/kubernetes/pull/1#discussion_r63440003","pull_request_url":"https://api.github.com/repos/yujuhong/kubernetes/pulls/1","_links":{"self":{"href":"https://api.github.com/repos/yujuhong/kubernetes/pulls/comments/63440003"},"html":{"href":"https://github.com/yujuhong/kubernetes/pull/1#discussion_r63440003"},"pull_request":{"href":"https://api.github.com/repos/yujuhong/kubernetes/pulls/1"}}},"pull_request":{"url":"https://api.github.com/repos/yujuhong/kubernetes/pulls/1","id":70045892,"html_url":"https://github.com/yujuhong/kubernetes/pull/1","diff_url":"https://github.com/yujuhong/kubernetes/pull/1.diff","patch_url":"https://github.com/yujuhong/kubernetes/pull/1.patch","issue_url":"https://api.github.com/repos/yujuhong/kubernetes/issues/1","number":1,"state":"open","locked":false,"title":"The first attempt to define a new container runtime interface","user":{"login":"yujuhong","id":10524058,"avatar_url":"https://avatars.githubusercontent.com/u/10524058?v=3","gravatar_id":"","url":"https://api.github.com/users/yujuhong","html_url":"https://github.com/yujuhong","followers_url":"https://api.github.com/users/yujuhong/followers","following_url":"https://api.github.com/users/yujuhong/following{/other_user}","gists_url":"https://api.github.com/users/yujuhong/gists{/gist_id}","starred_url":"https://api.github.com/users/yujuhong/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/yujuhong/subscriptions","organizations_url":"https://api.github.com/users/yujuhong/orgs","repos_url":"https://api.github.com/users/yujuhong/repos","events_url":"https://api.github.com/users/yujuhong/events{/privacy}","received_events_url":"https://api.github.com/users/yujuhong/received_events","type":"User","site_admin":false},"body":"","created_at":"2016-05-13T19:25:59Z","updated_at":"2016-05-16T22:56:38Z","closed_at":null,"merged_at":null,"merge_commit_sha":"45e1c8a3445dfc80c8a6f417336a458a7265a169","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/yujuhong/kubernetes/pulls/1/commits","review_comments_url":"https://api.github.com/repos/yujuhong/kubernetes/pulls/1/comments","review_comment_url":"https://api.github.com/repos/yujuhong/kubernetes/pulls/comments{/number}","comments_url":"https://api.github.com/repos/yujuhong/kubernetes/issues/1/comments","statuses_url":"https://api.github.com/repos/yujuhong/kubernetes/statuses/ddd041c68ca94d95fa591dce703932fe5d577dd0","head":{"label":"yujuhong:cri","ref":"cri","sha":"ddd041c68ca94d95fa591dce703932fe5d577dd0","user":{"login":"yujuhong","id":10524058,"avatar_url":"https://avatars.githubusercontent.com/u/10524058?v=3","gravatar_id":"","url":"https://api.github.com/users/yujuhong","html_url":"https://github.com/yujuhong","followers_url":"https://api.github.com/users/yujuhong/followers","following_url":"https://api.github.com/users/yujuhong/following{/other_user}","gists_url":"https://api.github.com/users/yujuhong/gists{/gist_id}","starred_url":"https://api.github.com/users/yujuhong/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/yujuhong/subscriptions","organizations_url":"https://api.github.com/users/yujuhong/orgs","repos_url":"https://api.github.com/users/yujuhong/repos","events_url":"https://api.github.com/users/yujuhong/events{/privacy}","received_events_url":"https://api.github.com/users/yujuhong/received_events","type":"User","site_admin":false},"repo":{"id":29618390,"name":"kubernetes","full_name":"yujuhong/kubernetes","owner":{"login":"yujuhong","id":10524058,"avatar_url":"https://avatars.githubusercontent.com/u/10524058?v=3","gravatar_id":"","url":"https://api.github.com/users/yujuhong","html_url":"https://github.com/yujuhong","followers_url":"https://api.github.com/users/yujuhong/followers","following_url":"https://api.github.com/users/yujuhong/following{/other_user}","gists_url":"https://api.github.com/users/yujuhong/gists{/gist_id}","starred_url":"https://api.github.com/users/yujuhong/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/yujuhong/subscriptions","organizations_url":"https://api.github.com/users/yujuhong/orgs","repos_url":"https://api.github.com/users/yujuhong/repos","events_url":"https://api.github.com/users/yujuhong/events{/privacy}","received_events_url":"https://api.github.com/users/yujuhong/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/yujuhong/kubernetes","description":"Container Cluster Manager","fork":true,"url":"https://api.github.com/repos/yujuhong/kubernetes","forks_url":"https://api.github.com/repos/yujuhong/kubernetes/forks","keys_url":"https://api.github.com/repos/yujuhong/kubernetes/keys{/key_id}","collaborators_url":"https://api.github.com/repos/yujuhong/kubernetes/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/yujuhong/kubernetes/teams","hooks_url":"https://api.github.com/repos/yujuhong/kubernetes/hooks","issue_events_url":"https://api.github.com/repos/yujuhong/kubernetes/issues/events{/number}","events_url":"https://api.github.com/repos/yujuhong/kubernetes/events","assignees_url":"https://api.github.com/repos/yujuhong/kubernetes/assignees{/user}","branches_url":"https://api.github.com/repos/yujuhong/kubernetes/branches{/branch}","tags_url":"https://api.github.com/repos/yujuhong/kubernetes/tags","blobs_url":"https://api.github.com/repos/yujuhong/kubernetes/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/yujuhong/kubernetes/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/yujuhong/kubernetes/git/refs{/sha}","trees_url":"https://api.github.com/repos/yujuhong/kubernetes/git/trees{/sha}","statuses_url":"https://api.github.com/repos/yujuhong/kubernetes/statuses/{sha}","languages_url":"https://api.github.com/repos/yujuhong/kubernetes/languages","stargazers_url":"https://api.github.com/repos/yujuhong/kubernetes/stargazers","contributors_url":"https://api.github.com/repos/yujuhong/kubernetes/contributors","subscribers_url":"https://api.github.com/repos/yujuhong/kubernetes/subscribers","subscription_url":"https://api.github.com/repos/yujuhong/kubernetes/subscription","commits_url":"https://api.github.com/repos/yujuhong/kubernetes/commits{/sha}","git_commits_url":"https://api.github.com/repos/yujuhong/kubernetes/git/commits{/sha}","comments_url":"https://api.github.com/repos/yujuhong/kubernetes/comments{/number}","issue_comment_url":"https://api.github.com/repos/yujuhong/kubernetes/issues/comments{/number}","contents_url":"https://api.github.com/repos/yujuhong/kubernetes/contents/{+path}","compare_url":"https://api.github.com/repos/yujuhong/kubernetes/compare/{base}...{head}","merges_url":"https://api.github.com/repos/yujuhong/kubernetes/merges","archive_url":"https://api.github.com/repos/yujuhong/kubernetes/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/yujuhong/kubernetes/downloads","issues_url":"https://api.github.com/repos/yujuhong/kubernetes/issues{/number}","pulls_url":"https://api.github.com/repos/yujuhong/kubernetes/pulls{/number}","milestones_url":"https://api.github.com/repos/yujuhong/kubernetes/milestones{/number}","notifications_url":"https://api.github.com/repos/yujuhong/kubernetes/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/yujuhong/kubernetes/labels{/name}","releases_url":"https://api.github.com/repos/yujuhong/kubernetes/releases{/id}","deployments_url":"https://api.github.com/repos/yujuhong/kubernetes/deployments","created_at":"2015-01-21T21:45:40Z","updated_at":"2016-01-21T20:42:14Z","pushed_at":"2016-05-13T23:51:27Z","git_url":"git://github.com/yujuhong/kubernetes.git","ssh_url":"git@github.com:yujuhong/kubernetes.git","clone_url":"https://github.com/yujuhong/kubernetes.git","svn_url":"https://github.com/yujuhong/kubernetes","homepage":"http://kubernetes.io","size":188979,"stargazers_count":0,"watchers_count":0,"language":"Go","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":1,"forks":0,"open_issues":1,"watchers":0,"default_branch":"master"}},"base":{"label":"yujuhong:master","ref":"master","sha":"1616239b4ab26eeeac7c06240a5e214b7681d4dc","user":{"login":"yujuhong","id":10524058,"avatar_url":"https://avatars.githubusercontent.com/u/10524058?v=3","gravatar_id":"","url":"https://api.github.com/users/yujuhong","html_url":"https://github.com/yujuhong","followers_url":"https://api.github.com/users/yujuhong/followers","following_url":"https://api.github.com/users/yujuhong/following{/other_user}","gists_url":"https://api.github.com/users/yujuhong/gists{/gist_id}","starred_url":"https://api.github.com/users/yujuhong/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/yujuhong/subscriptions","organizations_url":"https://api.github.com/users/yujuhong/orgs","repos_url":"https://api.github.com/users/yujuhong/repos","events_url":"https://api.github.com/users/yujuhong/events{/privacy}","received_events_url":"https://api.github.com/users/yujuhong/received_events","type":"User","site_admin":false},"repo":{"id":29618390,"name":"kubernetes","full_name":"yujuhong/kubernetes","owner":{"login":"yujuhong","id":10524058,"avatar_url":"https://avatars.githubusercontent.com/u/10524058?v=3","gravatar_id":"","url":"https://api.github.com/users/yujuhong","html_url":"https://github.com/yujuhong","followers_url":"https://api.github.com/users/yujuhong/followers","following_url":"https://api.github.com/users/yujuhong/following{/other_user}","gists_url":"https://api.github.com/users/yujuhong/gists{/gist_id}","starred_url":"https://api.github.com/users/yujuhong/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/yujuhong/subscriptions","organizations_url":"https://api.github.com/users/yujuhong/orgs","repos_url":"https://api.github.com/users/yujuhong/repos","events_url":"https://api.github.com/users/yujuhong/events{/privacy}","received_events_url":"https://api.github.com/users/yujuhong/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/yujuhong/kubernetes","description":"Container Cluster Manager","fork":true,"url":"https://api.github.com/repos/yujuhong/kubernetes","forks_url":"https://api.github.com/repos/yujuhong/kubernetes/forks","keys_url":"https://api.github.com/repos/yujuhong/kubernetes/keys{/key_id}","collaborators_url":"https://api.github.com/repos/yujuhong/kubernetes/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/yujuhong/kubernetes/teams","hooks_url":"https://api.github.com/repos/yujuhong/kubernetes/hooks","issue_events_url":"https://api.github.com/repos/yujuhong/kubernetes/issues/events{/number}","events_url":"https://api.github.com/repos/yujuhong/kubernetes/events","assignees_url":"https://api.github.com/repos/yujuhong/kubernetes/assignees{/user}","branches_url":"https://api.github.com/repos/yujuhong/kubernetes/branches{/branch}","tags_url":"https://api.github.com/repos/yujuhong/kubernetes/tags","blobs_url":"https://api.github.com/repos/yujuhong/kubernetes/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/yujuhong/kubernetes/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/yujuhong/kubernetes/git/refs{/sha}","trees_url":"https://api.github.com/repos/yujuhong/kubernetes/git/trees{/sha}","statuses_url":"https://api.github.com/repos/yujuhong/kubernetes/statuses/{sha}","languages_url":"https://api.github.com/repos/yujuhong/kubernetes/languages","stargazers_url":"https://api.github.com/repos/yujuhong/kubernetes/stargazers","contributors_url":"https://api.github.com/repos/yujuhong/kubernetes/contributors","subscribers_url":"https://api.github.com/repos/yujuhong/kubernetes/subscribers","subscription_url":"https://api.github.com/repos/yujuhong/kubernetes/subscription","commits_url":"https://api.github.com/repos/yujuhong/kubernetes/commits{/sha}","git_commits_url":"https://api.github.com/repos/yujuhong/kubernetes/git/commits{/sha}","comments_url":"https://api.github.com/repos/yujuhong/kubernetes/comments{/number}","issue_comment_url":"https://api.github.com/repos/yujuhong/kubernetes/issues/comments{/number}","contents_url":"https://api.github.com/repos/yujuhong/kubernetes/contents/{+path}","compare_url":"https://api.github.com/repos/yujuhong/kubernetes/compare/{base}...{head}","merges_url":"https://api.github.com/repos/yujuhong/kubernetes/merges","archive_url":"https://api.github.com/repos/yujuhong/kubernetes/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/yujuhong/kubernetes/downloads","issues_url":"https://api.github.com/repos/yujuhong/kubernetes/issues{/number}","pulls_url":"https://api.github.com/repos/yujuhong/kubernetes/pulls{/number}","milestones_url":"https://api.github.com/repos/yujuhong/kubernetes/milestones{/number}","notifications_url":"https://api.github.com/repos/yujuhong/kubernetes/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/yujuhong/kubernetes/labels{/name}","releases_url":"https://api.github.com/repos/yujuhong/kubernetes/releases{/id}","deployments_url":"https://api.github.com/repos/yujuhong/kubernetes/deployments","created_at":"2015-01-21T21:45:40Z","updated_at":"2016-01-21T20:42:14Z","pushed_at":"2016-05-13T23:51:27Z","git_url":"git://github.com/yujuhong/kubernetes.git","ssh_url":"git@github.com:yujuhong/kubernetes.git","clone_url":"https://github.com/yujuhong/kubernetes.git","svn_url":"https://github.com/yujuhong/kubernetes","homepage":"http://kubernetes.io","size":188979,"stargazers_count":0,"watchers_count":0,"language":"Go","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":1,"forks":0,"open_issues":1,"watchers":0,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/yujuhong/kubernetes/pulls/1"},"html":{"href":"https://github.com/yujuhong/kubernetes/pull/1"},"issue":{"href":"https://api.github.com/repos/yujuhong/kubernetes/issues/1"},"comments":{"href":"https://api.github.com/repos/yujuhong/kubernetes/issues/1/comments"},"review_comments":{"href":"https://api.github.com/repos/yujuhong/kubernetes/pulls/1/comments"},"review_comment":{"href":"https://api.github.com/repos/yujuhong/kubernetes/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/yujuhong/kubernetes/pulls/1/commits"},"statuses":{"href":"https://api.github.com/repos/yujuhong/kubernetes/statuses/ddd041c68ca94d95fa591dce703932fe5d577dd0"}}}}