{"action":"created","comment":{"url":"https://api.github.com/repos/kubevirt/containerized-data-importer/pulls/comments/197269614","pull_request_review_id":130979504,"id":197269614,"node_id":"MDI0OlB1bGxSZXF1ZXN0UmV2aWV3Q29tbWVudDE5NzI2OTYxNA==","diff_hunk":"@@ -0,0 +1,264 @@\n+package controller\n+\n+import (\n+\t\"fmt\"\n+\t\"time\"\n+\t//\"encoding/json\"  temporary for debug\n+\t\"github.com/golang/glog\"\n+\t. \"github.com/kubevirt/containerized-data-importer/pkg/common\"\n+\t\"github.com/pkg/errors\"\n+\t\"k8s.io/api/core/v1\"\n+\tmetav1 \"k8s.io/apimachinery/pkg/apis/meta/v1\"\n+\t\"k8s.io/apimachinery/pkg/util/wait\"\n+\t\"k8s.io/client-go/kubernetes\"\n+\t\"k8s.io/client-go/tools/cache\"\n+\t\"k8s.io/client-go/util/workqueue\"\n+)\n+\n+const (\n+\t// pvc annotations\n+\tAnnCloneRequest    = \"k8s.io/CloneRequest\"\n+\tAnnCloneOf         = \"k8s.io/CloneOf\"\n+\tAnnCloneInProgress = \"cdi.kubevirt.io/storage.clone.inprogress\"\n+\t\n+)\n+\n+type CloneController struct {\n+\tclientset                kubernetes.Interface\n+\tpvcQueue, podQueue       workqueue.RateLimitingInterface\n+\tpvcInformer, podInformer cache.SharedIndexInformer\n+\tcloneImage               string\n+\tpullPolicy               string // Options: IfNotPresent, Always, or Never\n+\tverbose                  string // verbose levels: 1, 2, ...\n+}\n+\n+func NewCloneController(client kubernetes.Interface, pvcInformer, podInformer cache.SharedIndexInformer, cloneImage string, pullPolicy string, verbose string) *CloneController {\n+\tc := &CloneController{\n+\t\tclientset:     client,\n+\t\tpvcQueue:      workqueue.NewRateLimitingQueue(workqueue.DefaultControllerRateLimiter()),\n+\t\tpodQueue:      workqueue.NewRateLimitingQueue(workqueue.DefaultControllerRateLimiter()),\n+\t\tpvcInformer:   pvcInformer,\n+\t\tpodInformer:   podInformer,\n+\t\tcloneImage:    cloneImage,\n+\t\tpullPolicy:    pullPolicy,\n+\t\tverbose:       verbose,\n+\t}\n+\n+\t// Bind the pvc SharedIndexInformer to the pvc queue\n+\tc.pvcInformer.AddEventHandler(cache.ResourceEventHandlerFuncs{\n+\t\tAddFunc: func(obj interface{}) {\n+\t\t\tkey, err := cache.MetaNamespaceKeyFunc(obj)\n+\t\t\tif err == nil {\n+\t\t\t\tc.pvcQueue.AddRateLimited(key)\n+\t\t\t}\n+\t\t},\n+\t\t// this is triggered by an update or it will also be\n+\t\t// be triggered periodically even if no changes were made.\n+\t\tUpdateFunc: func(old, new interface{}) {\n+\t\t\tkey, err := cache.MetaNamespaceKeyFunc(new)\n+\t\t\tif err == nil {\n+\t\t\t\tc.pvcQueue.AddRateLimited(key)\n+\t\t\t}\n+\t\t},\n+\t})\n+\n+\t// Bind the pod SharedIndexInformer to the pod queue\n+\tc.podInformer.AddEventHandler(cache.ResourceEventHandlerFuncs{\n+\t\tAddFunc: func(obj interface{}) {\n+\t\t\tkey, err := cache.MetaNamespaceKeyFunc(obj)\n+\t\t\tif err == nil {\n+\t\t\t\tc.podQueue.AddRateLimited(key)\n+\t\t\t}\n+\t\t},\n+\t\tUpdateFunc: func(oldObj, newObj interface{}) {\n+\t\t\t\n+\t\t\t//TEMPORARY - for debug -  to be delete\n+\t\t\t//tmp, _ := json.Marshal(&newObj))\n+\t\t    //glog.V(Vdebug).Info(fmt.Println(string(tmp)))\n+\t\t\t///////////","path":"pkg/controller/clone-controller.go","position":78,"original_position":78,"commit_id":"ca271bd534babdd9c3fd63958fbf4d86e09a706c","original_commit_id":"ca271bd534babdd9c3fd63958fbf4d86e09a706c","user":{"login":"aglitke","id":333311,"node_id":"MDQ6VXNlcjMzMzMxMQ==","avatar_url":"https://avatars2.githubusercontent.com/u/333311?v=4","gravatar_id":"","url":"https://api.github.com/users/aglitke","html_url":"https://github.com/aglitke","followers_url":"https://api.github.com/users/aglitke/followers","following_url":"https://api.github.com/users/aglitke/following{/other_user}","gists_url":"https://api.github.com/users/aglitke/gists{/gist_id}","starred_url":"https://api.github.com/users/aglitke/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/aglitke/subscriptions","organizations_url":"https://api.github.com/users/aglitke/orgs","repos_url":"https://api.github.com/users/aglitke/repos","events_url":"https://api.github.com/users/aglitke/events{/privacy}","received_events_url":"https://api.github.com/users/aglitke/received_events","type":"User","site_admin":false},"body":"Remove commented code in final PR","created_at":"2018-06-21T20:38:46Z","updated_at":"2018-06-21T20:57:28Z","html_url":"https://github.com/kubevirt/containerized-data-importer/pull/219#discussion_r197269614","pull_request_url":"https://api.github.com/repos/kubevirt/containerized-data-importer/pulls/219","author_association":"MEMBER","_links":{"self":{"href":"https://api.github.com/repos/kubevirt/containerized-data-importer/pulls/comments/197269614"},"html":{"href":"https://github.com/kubevirt/containerized-data-importer/pull/219#discussion_r197269614"},"pull_request":{"href":"https://api.github.com/repos/kubevirt/containerized-data-importer/pulls/219"}}},"pull_request":{"url":"https://api.github.com/repos/kubevirt/containerized-data-importer/pulls/219","id":196117106,"node_id":"MDExOlB1bGxSZXF1ZXN0MTk2MTE3MTA2","html_url":"https://github.com/kubevirt/containerized-data-importer/pull/219","diff_url":"https://github.com/kubevirt/containerized-data-importer/pull/219.diff","patch_url":"https://github.com/kubevirt/containerized-data-importer/pull/219.patch","issue_url":"https://api.github.com/repos/kubevirt/containerized-data-importer/issues/219","number":219,"state":"open","locked":false,"title":"[WIP] Host-assisted cloning integrated to CDI","user":{"login":"zvikorn","id":29862284,"node_id":"MDQ6VXNlcjI5ODYyMjg0","avatar_url":"https://avatars1.githubusercontent.com/u/29862284?v=4","gravatar_id":"","url":"https://api.github.com/users/zvikorn","html_url":"https://github.com/zvikorn","followers_url":"https://api.github.com/users/zvikorn/followers","following_url":"https://api.github.com/users/zvikorn/following{/other_user}","gists_url":"https://api.github.com/users/zvikorn/gists{/gist_id}","starred_url":"https://api.github.com/users/zvikorn/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/zvikorn/subscriptions","organizations_url":"https://api.github.com/users/zvikorn/orgs","repos_url":"https://api.github.com/users/zvikorn/repos","events_url":"https://api.github.com/users/zvikorn/events{/privacy}","received_events_url":"https://api.github.com/users/zvikorn/received_events","type":"User","site_admin":false},"body":"Still need to add 'CloneOf' on cloning completion.\r\nI might also find a way to label the node automatically, for the the NodeAffinity.\r\n","created_at":"2018-06-20T12:12:34Z","updated_at":"2018-06-21T20:57:28Z","closed_at":null,"merged_at":null,"merge_commit_sha":"94dc8aac1a6d1e331fda5dd9bcf0c6a4c8f360a9","assignee":null,"assignees":[],"requested_reviewers":[],"requested_teams":[],"labels":[],"milestone":null,"commits_url":"https://api.github.com/repos/kubevirt/containerized-data-importer/pulls/219/commits","review_comments_url":"https://api.github.com/repos/kubevirt/containerized-data-importer/pulls/219/comments","review_comment_url":"https://api.github.com/repos/kubevirt/containerized-data-importer/pulls/comments{/number}","comments_url":"https://api.github.com/repos/kubevirt/containerized-data-importer/issues/219/comments","statuses_url":"https://api.github.com/repos/kubevirt/containerized-data-importer/statuses/ca271bd534babdd9c3fd63958fbf4d86e09a706c","head":{"label":"zvikorn:master","ref":"master","sha":"ca271bd534babdd9c3fd63958fbf4d86e09a706c","user":{"login":"zvikorn","id":29862284,"node_id":"MDQ6VXNlcjI5ODYyMjg0","avatar_url":"https://avatars1.githubusercontent.com/u/29862284?v=4","gravatar_id":"","url":"https://api.github.com/users/zvikorn","html_url":"https://github.com/zvikorn","followers_url":"https://api.github.com/users/zvikorn/followers","following_url":"https://api.github.com/users/zvikorn/following{/other_user}","gists_url":"https://api.github.com/users/zvikorn/gists{/gist_id}","starred_url":"https://api.github.com/users/zvikorn/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/zvikorn/subscriptions","organizations_url":"https://api.github.com/users/zvikorn/orgs","repos_url":"https://api.github.com/users/zvikorn/repos","events_url":"https://api.github.com/users/zvikorn/events{/privacy}","received_events_url":"https://api.github.com/users/zvikorn/received_events","type":"User","site_admin":false},"repo":{"id":137721708,"node_id":"MDEwOlJlcG9zaXRvcnkxMzc3MjE3MDg=","name":"containerized-data-importer","full_name":"zvikorn/containerized-data-importer","owner":{"login":"zvikorn","id":29862284,"node_id":"MDQ6VXNlcjI5ODYyMjg0","avatar_url":"https://avatars1.githubusercontent.com/u/29862284?v=4","gravatar_id":"","url":"https://api.github.com/users/zvikorn","html_url":"https://github.com/zvikorn","followers_url":"https://api.github.com/users/zvikorn/followers","following_url":"https://api.github.com/users/zvikorn/following{/other_user}","gists_url":"https://api.github.com/users/zvikorn/gists{/gist_id}","starred_url":"https://api.github.com/users/zvikorn/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/zvikorn/subscriptions","organizations_url":"https://api.github.com/users/zvikorn/orgs","repos_url":"https://api.github.com/users/zvikorn/repos","events_url":"https://api.github.com/users/zvikorn/events{/privacy}","received_events_url":"https://api.github.com/users/zvikorn/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/zvikorn/containerized-data-importer","description":"Data Import Service for kubernetes, designed with kubevirt in mind.","fork":true,"url":"https://api.github.com/repos/zvikorn/containerized-data-importer","forks_url":"https://api.github.com/repos/zvikorn/containerized-data-importer/forks","keys_url":"https://api.github.com/repos/zvikorn/containerized-data-importer/keys{/key_id}","collaborators_url":"https://api.github.com/repos/zvikorn/containerized-data-importer/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/zvikorn/containerized-data-importer/teams","hooks_url":"https://api.github.com/repos/zvikorn/containerized-data-importer/hooks","issue_events_url":"https://api.github.com/repos/zvikorn/containerized-data-importer/issues/events{/number}","events_url":"https://api.github.com/repos/zvikorn/containerized-data-importer/events","assignees_url":"https://api.github.com/repos/zvikorn/containerized-data-importer/assignees{/user}","branches_url":"https://api.github.com/repos/zvikorn/containerized-data-importer/branches{/branch}","tags_url":"https://api.github.com/repos/zvikorn/containerized-data-importer/tags","blobs_url":"https://api.github.com/repos/zvikorn/containerized-data-importer/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/zvikorn/containerized-data-importer/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/zvikorn/containerized-data-importer/git/refs{/sha}","trees_url":"https://api.github.com/repos/zvikorn/containerized-data-importer/git/trees{/sha}","statuses_url":"https://api.github.com/repos/zvikorn/containerized-data-importer/statuses/{sha}","languages_url":"https://api.github.com/repos/zvikorn/containerized-data-importer/languages","stargazers_url":"https://api.github.com/repos/zvikorn/containerized-data-importer/stargazers","contributors_url":"https://api.github.com/repos/zvikorn/containerized-data-importer/contributors","subscribers_url":"https://api.github.com/repos/zvikorn/containerized-data-importer/subscribers","subscription_url":"https://api.github.com/repos/zvikorn/containerized-data-importer/subscription","commits_url":"https://api.github.com/repos/zvikorn/containerized-data-importer/commits{/sha}","git_commits_url":"https://api.github.com/repos/zvikorn/containerized-data-importer/git/commits{/sha}","comments_url":"https://api.github.com/repos/zvikorn/containerized-data-importer/comments{/number}","issue_comment_url":"https://api.github.com/repos/zvikorn/containerized-data-importer/issues/comments{/number}","contents_url":"https://api.github.com/repos/zvikorn/containerized-data-importer/contents/{+path}","compare_url":"https://api.github.com/repos/zvikorn/containerized-data-importer/compare/{base}...{head}","merges_url":"https://api.github.com/repos/zvikorn/containerized-data-importer/merges","archive_url":"https://api.github.com/repos/zvikorn/containerized-data-importer/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/zvikorn/containerized-data-importer/downloads","issues_url":"https://api.github.com/repos/zvikorn/containerized-data-importer/issues{/number}","pulls_url":"https://api.github.com/repos/zvikorn/containerized-data-importer/pulls{/number}","milestones_url":"https://api.github.com/repos/zvikorn/containerized-data-importer/milestones{/number}","notifications_url":"https://api.github.com/repos/zvikorn/containerized-data-importer/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/zvikorn/containerized-data-importer/labels{/name}","releases_url":"https://api.github.com/repos/zvikorn/containerized-data-importer/releases{/id}","deployments_url":"https://api.github.com/repos/zvikorn/containerized-data-importer/deployments","created_at":"2018-06-18T07:26:36Z","updated_at":"2018-06-21T10:48:57Z","pushed_at":"2018-06-21T10:48:55Z","git_url":"git://github.com/zvikorn/containerized-data-importer.git","ssh_url":"git@github.com:zvikorn/containerized-data-importer.git","clone_url":"https://github.com/zvikorn/containerized-data-importer.git","svn_url":"https://github.com/zvikorn/containerized-data-importer","homepage":"","size":35084,"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":"kubevirt:master","ref":"master","sha":"1e16a9d5fdec729b00977aa6142154628ac4674d","user":{"login":"kubevirt","id":18700703,"node_id":"MDEyOk9yZ2FuaXphdGlvbjE4NzAwNzAz","avatar_url":"https://avatars1.githubusercontent.com/u/18700703?v=4","gravatar_id":"","url":"https://api.github.com/users/kubevirt","html_url":"https://github.com/kubevirt","followers_url":"https://api.github.com/users/kubevirt/followers","following_url":"https://api.github.com/users/kubevirt/following{/other_user}","gists_url":"https://api.github.com/users/kubevirt/gists{/gist_id}","starred_url":"https://api.github.com/users/kubevirt/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kubevirt/subscriptions","organizations_url":"https://api.github.com/users/kubevirt/orgs","repos_url":"https://api.github.com/users/kubevirt/repos","events_url":"https://api.github.com/users/kubevirt/events{/privacy}","received_events_url":"https://api.github.com/users/kubevirt/received_events","type":"Organization","site_admin":false},"repo":{"id":117756215,"node_id":"MDEwOlJlcG9zaXRvcnkxMTc3NTYyMTU=","name":"containerized-data-importer","full_name":"kubevirt/containerized-data-importer","owner":{"login":"kubevirt","id":18700703,"node_id":"MDEyOk9yZ2FuaXphdGlvbjE4NzAwNzAz","avatar_url":"https://avatars1.githubusercontent.com/u/18700703?v=4","gravatar_id":"","url":"https://api.github.com/users/kubevirt","html_url":"https://github.com/kubevirt","followers_url":"https://api.github.com/users/kubevirt/followers","following_url":"https://api.github.com/users/kubevirt/following{/other_user}","gists_url":"https://api.github.com/users/kubevirt/gists{/gist_id}","starred_url":"https://api.github.com/users/kubevirt/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kubevirt/subscriptions","organizations_url":"https://api.github.com/users/kubevirt/orgs","repos_url":"https://api.github.com/users/kubevirt/repos","events_url":"https://api.github.com/users/kubevirt/events{/privacy}","received_events_url":"https://api.github.com/users/kubevirt/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/kubevirt/containerized-data-importer","description":"Data Import Service for kubernetes, designed with kubevirt in mind.","fork":false,"url":"https://api.github.com/repos/kubevirt/containerized-data-importer","forks_url":"https://api.github.com/repos/kubevirt/containerized-data-importer/forks","keys_url":"https://api.github.com/repos/kubevirt/containerized-data-importer/keys{/key_id}","collaborators_url":"https://api.github.com/repos/kubevirt/containerized-data-importer/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/kubevirt/containerized-data-importer/teams","hooks_url":"https://api.github.com/repos/kubevirt/containerized-data-importer/hooks","issue_events_url":"https://api.github.com/repos/kubevirt/containerized-data-importer/issues/events{/number}","events_url":"https://api.github.com/repos/kubevirt/containerized-data-importer/events","assignees_url":"https://api.github.com/repos/kubevirt/containerized-data-importer/assignees{/user}","branches_url":"https://api.github.com/repos/kubevirt/containerized-data-importer/branches{/branch}","tags_url":"https://api.github.com/repos/kubevirt/containerized-data-importer/tags","blobs_url":"https://api.github.com/repos/kubevirt/containerized-data-importer/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/kubevirt/containerized-data-importer/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/kubevirt/containerized-data-importer/git/refs{/sha}","trees_url":"https://api.github.com/repos/kubevirt/containerized-data-importer/git/trees{/sha}","statuses_url":"https://api.github.com/repos/kubevirt/containerized-data-importer/statuses/{sha}","languages_url":"https://api.github.com/repos/kubevirt/containerized-data-importer/languages","stargazers_url":"https://api.github.com/repos/kubevirt/containerized-data-importer/stargazers","contributors_url":"https://api.github.com/repos/kubevirt/containerized-data-importer/contributors","subscribers_url":"https://api.github.com/repos/kubevirt/containerized-data-importer/subscribers","subscription_url":"https://api.github.com/repos/kubevirt/containerized-data-importer/subscription","commits_url":"https://api.github.com/repos/kubevirt/containerized-data-importer/commits{/sha}","git_commits_url":"https://api.github.com/repos/kubevirt/containerized-data-importer/git/commits{/sha}","comments_url":"https://api.github.com/repos/kubevirt/containerized-data-importer/comments{/number}","issue_comment_url":"https://api.github.com/repos/kubevirt/containerized-data-importer/issues/comments{/number}","contents_url":"https://api.github.com/repos/kubevirt/containerized-data-importer/contents/{+path}","compare_url":"https://api.github.com/repos/kubevirt/containerized-data-importer/compare/{base}...{head}","merges_url":"https://api.github.com/repos/kubevirt/containerized-data-importer/merges","archive_url":"https://api.github.com/repos/kubevirt/containerized-data-importer/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/kubevirt/containerized-data-importer/downloads","issues_url":"https://api.github.com/repos/kubevirt/containerized-data-importer/issues{/number}","pulls_url":"https://api.github.com/repos/kubevirt/containerized-data-importer/pulls{/number}","milestones_url":"https://api.github.com/repos/kubevirt/containerized-data-importer/milestones{/number}","notifications_url":"https://api.github.com/repos/kubevirt/containerized-data-importer/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/kubevirt/containerized-data-importer/labels{/name}","releases_url":"https://api.github.com/repos/kubevirt/containerized-data-importer/releases{/id}","deployments_url":"https://api.github.com/repos/kubevirt/containerized-data-importer/deployments","created_at":"2018-01-16T23:35:48Z","updated_at":"2018-06-21T19:14:28Z","pushed_at":"2018-06-21T19:21:27Z","git_url":"git://github.com/kubevirt/containerized-data-importer.git","ssh_url":"git@github.com:kubevirt/containerized-data-importer.git","clone_url":"https://github.com/kubevirt/containerized-data-importer.git","svn_url":"https://github.com/kubevirt/containerized-data-importer","homepage":"","size":35081,"stargazers_count":4,"watchers_count":4,"language":"Go","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":10,"mirror_url":null,"archived":false,"open_issues_count":15,"license":null,"forks":10,"open_issues":15,"watchers":4,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/kubevirt/containerized-data-importer/pulls/219"},"html":{"href":"https://github.com/kubevirt/containerized-data-importer/pull/219"},"issue":{"href":"https://api.github.com/repos/kubevirt/containerized-data-importer/issues/219"},"comments":{"href":"https://api.github.com/repos/kubevirt/containerized-data-importer/issues/219/comments"},"review_comments":{"href":"https://api.github.com/repos/kubevirt/containerized-data-importer/pulls/219/comments"},"review_comment":{"href":"https://api.github.com/repos/kubevirt/containerized-data-importer/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/kubevirt/containerized-data-importer/pulls/219/commits"},"statuses":{"href":"https://api.github.com/repos/kubevirt/containerized-data-importer/statuses/ca271bd534babdd9c3fd63958fbf4d86e09a706c"}},"author_association":"NONE"}}
{"actor":{"display_login":"aglitke"}}