{"action":"created","comment":{"url":"https://api.github.com/repos/kubernetes/kubernetes/pulls/comments/43858909","id":43858909,"diff_hunk":"@@ -155,3 +160,32 @@ func NewEtcdTestClientServer(t *testing.T) *EtcdTestServer {\n \t}\n \treturn server\n }\n+\n+// NewEtcdTestStorage creates a new storage.Interface and TestServer\n+func NewEtcdTestStorage(t *testing.T, codec runtime.Codec, prefix string) (*EtcdTestServer, storage.Interface) {\n+\tserver := NewEtcdTestClientServer(t)\n+\tstorage := NewEtcdStorage(server.client, codec, prefix)\n+\treturn server, storage\n+}\n+\n+// CreateObj will create a single object using the storage interface\n+func CreateObj(t *testing.T, helper storage.Interface, name string, obj, out runtime.Object, ttl uint64) error {\n+\terr := helper.Set(context.TODO(), name, obj, out, ttl)\n+\tif err != nil {\n+\t\tt.Errorf(\"Unexpected error %v\", err)\n+\t}\n+\treturn err\n+}\n+\n+// CreatePodList will properly create a podlist using the storage interface\n+func CreatePodList(t *testing.T, prefix string, helper storage.Interface, list *api.PodList) error {","path":"pkg/storage/etcd/etcd_test_util.go","position":44,"original_position":44,"commit_id":"88e4206d339a718cab2175135cc4ad687bce08b9","original_commit_id":"9206ede83d920ffdb045379d093364132c202827","user":{"login":"wojtek-t","id":10743879,"avatar_url":"https://avatars.githubusercontent.com/u/10743879?v=3","gravatar_id":"","url":"https://api.github.com/users/wojtek-t","html_url":"https://github.com/wojtek-t","followers_url":"https://api.github.com/users/wojtek-t/followers","following_url":"https://api.github.com/users/wojtek-t/following{/other_user}","gists_url":"https://api.github.com/users/wojtek-t/gists{/gist_id}","starred_url":"https://api.github.com/users/wojtek-t/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/wojtek-t/subscriptions","organizations_url":"https://api.github.com/users/wojtek-t/orgs","repos_url":"https://api.github.com/users/wojtek-t/repos","events_url":"https://api.github.com/users/wojtek-t/events{/privacy}","received_events_url":"https://api.github.com/users/wojtek-t/received_events","type":"User","site_admin":false},"body":"+1 for reusing generic infrastructure (I forgot about these functions)\r\nShouldn't something like that work:\r\n\r\nfunc CreateList(t *testing.T, prefix string, helper storage.Interface, list runtime.Object) error {\r\n  items, err := runtime.ExtractList(list)\r\n  // handle error\r\n  for i item := range items {\r\n    returnedObj := reflect.New(reflect.TypeOf(item)).Interface().(runtime.Object)\r\n    meta, err := meta.Accessory(item)\r\n    // handle error\r\n    err := CreateObj(t, helper, path.Join(prefix, meta.Name(), item, returnedObj, 0)\r\n    // handle error\r\n    items[i] = returnedObj\r\n  }\r\n  err := runtime.SetList(list, items)\r\n  // handle error\r\n  return nil\r\n}\r\n  \r\n  \r\n","created_at":"2015-11-04T09:39:58Z","updated_at":"2015-11-04T09:39:58Z","html_url":"https://github.com/kubernetes/kubernetes/pull/16610#discussion_r43858909","pull_request_url":"https://api.github.com/repos/kubernetes/kubernetes/pulls/16610","_links":{"self":{"href":"https://api.github.com/repos/kubernetes/kubernetes/pulls/comments/43858909"},"html":{"href":"https://github.com/kubernetes/kubernetes/pull/16610#discussion_r43858909"},"pull_request":{"href":"https://api.github.com/repos/kubernetes/kubernetes/pulls/16610"}}},"pull_request":{"url":"https://api.github.com/repos/kubernetes/kubernetes/pulls/16610","id":49316771,"html_url":"https://github.com/kubernetes/kubernetes/pull/16610","diff_url":"https://github.com/kubernetes/kubernetes/pull/16610.diff","patch_url":"https://github.com/kubernetes/kubernetes/pull/16610.patch","issue_url":"https://api.github.com/repos/kubernetes/kubernetes/issues/16610","number":16610,"state":"open","locked":false,"title":"Removal of fakeClient from registry/generic/etcd/etcd_test.go ","user":{"login":"timothysc","id":169553,"avatar_url":"https://avatars.githubusercontent.com/u/169553?v=3","gravatar_id":"","url":"https://api.github.com/users/timothysc","html_url":"https://github.com/timothysc","followers_url":"https://api.github.com/users/timothysc/followers","following_url":"https://api.github.com/users/timothysc/following{/other_user}","gists_url":"https://api.github.com/users/timothysc/gists{/gist_id}","starred_url":"https://api.github.com/users/timothysc/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/timothysc/subscriptions","organizations_url":"https://api.github.com/users/timothysc/orgs","repos_url":"https://api.github.com/users/timothysc/repos","events_url":"https://api.github.com/users/timothysc/events{/privacy}","received_events_url":"https://api.github.com/users/timothysc/received_events","type":"User","site_admin":false},"body":"Continuation from #15349, stemming from #11962\r\nThis commit removes fakeClient from registry/generic/etcd/etcd_test.go  in lieu of NewEtcdTestClientServer.\r\n\r\nPlease verify comment on unconditional update\r\n@lavalamp @wojtek-t","created_at":"2015-10-30T20:11:11Z","updated_at":"2015-11-04T09:39:58Z","closed_at":null,"merged_at":null,"merge_commit_sha":"fd8fff2258469375db01b05d0e8bd89d08eeeab1","assignee":{"login":"wojtek-t","id":10743879,"avatar_url":"https://avatars.githubusercontent.com/u/10743879?v=3","gravatar_id":"","url":"https://api.github.com/users/wojtek-t","html_url":"https://github.com/wojtek-t","followers_url":"https://api.github.com/users/wojtek-t/followers","following_url":"https://api.github.com/users/wojtek-t/following{/other_user}","gists_url":"https://api.github.com/users/wojtek-t/gists{/gist_id}","starred_url":"https://api.github.com/users/wojtek-t/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/wojtek-t/subscriptions","organizations_url":"https://api.github.com/users/wojtek-t/orgs","repos_url":"https://api.github.com/users/wojtek-t/repos","events_url":"https://api.github.com/users/wojtek-t/events{/privacy}","received_events_url":"https://api.github.com/users/wojtek-t/received_events","type":"User","site_admin":false},"milestone":null,"commits_url":"https://api.github.com/repos/kubernetes/kubernetes/pulls/16610/commits","review_comments_url":"https://api.github.com/repos/kubernetes/kubernetes/pulls/16610/comments","review_comment_url":"https://api.github.com/repos/kubernetes/kubernetes/pulls/comments{/number}","comments_url":"https://api.github.com/repos/kubernetes/kubernetes/issues/16610/comments","statuses_url":"https://api.github.com/repos/kubernetes/kubernetes/statuses/88e4206d339a718cab2175135cc4ad687bce08b9","head":{"label":"timothysc:etcd-remove-fakeclient-part3","ref":"etcd-remove-fakeclient-part3","sha":"88e4206d339a718cab2175135cc4ad687bce08b9","user":{"login":"timothysc","id":169553,"avatar_url":"https://avatars.githubusercontent.com/u/169553?v=3","gravatar_id":"","url":"https://api.github.com/users/timothysc","html_url":"https://github.com/timothysc","followers_url":"https://api.github.com/users/timothysc/followers","following_url":"https://api.github.com/users/timothysc/following{/other_user}","gists_url":"https://api.github.com/users/timothysc/gists{/gist_id}","starred_url":"https://api.github.com/users/timothysc/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/timothysc/subscriptions","organizations_url":"https://api.github.com/users/timothysc/orgs","repos_url":"https://api.github.com/users/timothysc/repos","events_url":"https://api.github.com/users/timothysc/events{/privacy}","received_events_url":"https://api.github.com/users/timothysc/received_events","type":"User","site_admin":false},"repo":{"id":28345483,"name":"kubernetes","full_name":"timothysc/kubernetes","owner":{"login":"timothysc","id":169553,"avatar_url":"https://avatars.githubusercontent.com/u/169553?v=3","gravatar_id":"","url":"https://api.github.com/users/timothysc","html_url":"https://github.com/timothysc","followers_url":"https://api.github.com/users/timothysc/followers","following_url":"https://api.github.com/users/timothysc/following{/other_user}","gists_url":"https://api.github.com/users/timothysc/gists{/gist_id}","starred_url":"https://api.github.com/users/timothysc/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/timothysc/subscriptions","organizations_url":"https://api.github.com/users/timothysc/orgs","repos_url":"https://api.github.com/users/timothysc/repos","events_url":"https://api.github.com/users/timothysc/events{/privacy}","received_events_url":"https://api.github.com/users/timothysc/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/timothysc/kubernetes","description":"Container Cluster Manager","fork":true,"url":"https://api.github.com/repos/timothysc/kubernetes","forks_url":"https://api.github.com/repos/timothysc/kubernetes/forks","keys_url":"https://api.github.com/repos/timothysc/kubernetes/keys{/key_id}","collaborators_url":"https://api.github.com/repos/timothysc/kubernetes/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/timothysc/kubernetes/teams","hooks_url":"https://api.github.com/repos/timothysc/kubernetes/hooks","issue_events_url":"https://api.github.com/repos/timothysc/kubernetes/issues/events{/number}","events_url":"https://api.github.com/repos/timothysc/kubernetes/events","assignees_url":"https://api.github.com/repos/timothysc/kubernetes/assignees{/user}","branches_url":"https://api.github.com/repos/timothysc/kubernetes/branches{/branch}","tags_url":"https://api.github.com/repos/timothysc/kubernetes/tags","blobs_url":"https://api.github.com/repos/timothysc/kubernetes/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/timothysc/kubernetes/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/timothysc/kubernetes/git/refs{/sha}","trees_url":"https://api.github.com/repos/timothysc/kubernetes/git/trees{/sha}","statuses_url":"https://api.github.com/repos/timothysc/kubernetes/statuses/{sha}","languages_url":"https://api.github.com/repos/timothysc/kubernetes/languages","stargazers_url":"https://api.github.com/repos/timothysc/kubernetes/stargazers","contributors_url":"https://api.github.com/repos/timothysc/kubernetes/contributors","subscribers_url":"https://api.github.com/repos/timothysc/kubernetes/subscribers","subscription_url":"https://api.github.com/repos/timothysc/kubernetes/subscription","commits_url":"https://api.github.com/repos/timothysc/kubernetes/commits{/sha}","git_commits_url":"https://api.github.com/repos/timothysc/kubernetes/git/commits{/sha}","comments_url":"https://api.github.com/repos/timothysc/kubernetes/comments{/number}","issue_comment_url":"https://api.github.com/repos/timothysc/kubernetes/issues/comments{/number}","contents_url":"https://api.github.com/repos/timothysc/kubernetes/contents/{+path}","compare_url":"https://api.github.com/repos/timothysc/kubernetes/compare/{base}...{head}","merges_url":"https://api.github.com/repos/timothysc/kubernetes/merges","archive_url":"https://api.github.com/repos/timothysc/kubernetes/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/timothysc/kubernetes/downloads","issues_url":"https://api.github.com/repos/timothysc/kubernetes/issues{/number}","pulls_url":"https://api.github.com/repos/timothysc/kubernetes/pulls{/number}","milestones_url":"https://api.github.com/repos/timothysc/kubernetes/milestones{/number}","notifications_url":"https://api.github.com/repos/timothysc/kubernetes/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/timothysc/kubernetes/labels{/name}","releases_url":"https://api.github.com/repos/timothysc/kubernetes/releases{/id}","created_at":"2014-12-22T15:52:58Z","updated_at":"2015-03-06T19:21:46Z","pushed_at":"2015-11-04T04:17:11Z","git_url":"git://github.com/timothysc/kubernetes.git","ssh_url":"git@github.com:timothysc/kubernetes.git","clone_url":"https://github.com/timothysc/kubernetes.git","svn_url":"https://github.com/timothysc/kubernetes","homepage":null,"size":127988,"stargazers_count":0,"watchers_count":0,"language":"Go","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":true,"forks_count":0,"mirror_url":null,"open_issues_count":1,"forks":0,"open_issues":1,"watchers":0,"default_branch":"master"}},"base":{"label":"kubernetes:master","ref":"master","sha":"1407fd2071ea32603edded01b453465095403e8f","user":{"login":"kubernetes","id":13629408,"avatar_url":"https://avatars.githubusercontent.com/u/13629408?v=3","gravatar_id":"","url":"https://api.github.com/users/kubernetes","html_url":"https://github.com/kubernetes","followers_url":"https://api.github.com/users/kubernetes/followers","following_url":"https://api.github.com/users/kubernetes/following{/other_user}","gists_url":"https://api.github.com/users/kubernetes/gists{/gist_id}","starred_url":"https://api.github.com/users/kubernetes/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kubernetes/subscriptions","organizations_url":"https://api.github.com/users/kubernetes/orgs","repos_url":"https://api.github.com/users/kubernetes/repos","events_url":"https://api.github.com/users/kubernetes/events{/privacy}","received_events_url":"https://api.github.com/users/kubernetes/received_events","type":"Organization","site_admin":false},"repo":{"id":20580498,"name":"kubernetes","full_name":"kubernetes/kubernetes","owner":{"login":"kubernetes","id":13629408,"avatar_url":"https://avatars.githubusercontent.com/u/13629408?v=3","gravatar_id":"","url":"https://api.github.com/users/kubernetes","html_url":"https://github.com/kubernetes","followers_url":"https://api.github.com/users/kubernetes/followers","following_url":"https://api.github.com/users/kubernetes/following{/other_user}","gists_url":"https://api.github.com/users/kubernetes/gists{/gist_id}","starred_url":"https://api.github.com/users/kubernetes/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kubernetes/subscriptions","organizations_url":"https://api.github.com/users/kubernetes/orgs","repos_url":"https://api.github.com/users/kubernetes/repos","events_url":"https://api.github.com/users/kubernetes/events{/privacy}","received_events_url":"https://api.github.com/users/kubernetes/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/kubernetes/kubernetes","description":"Container Cluster Manager from Google","fork":false,"url":"https://api.github.com/repos/kubernetes/kubernetes","forks_url":"https://api.github.com/repos/kubernetes/kubernetes/forks","keys_url":"https://api.github.com/repos/kubernetes/kubernetes/keys{/key_id}","collaborators_url":"https://api.github.com/repos/kubernetes/kubernetes/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/kubernetes/kubernetes/teams","hooks_url":"https://api.github.com/repos/kubernetes/kubernetes/hooks","issue_events_url":"https://api.github.com/repos/kubernetes/kubernetes/issues/events{/number}","events_url":"https://api.github.com/repos/kubernetes/kubernetes/events","assignees_url":"https://api.github.com/repos/kubernetes/kubernetes/assignees{/user}","branches_url":"https://api.github.com/repos/kubernetes/kubernetes/branches{/branch}","tags_url":"https://api.github.com/repos/kubernetes/kubernetes/tags","blobs_url":"https://api.github.com/repos/kubernetes/kubernetes/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/kubernetes/kubernetes/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/kubernetes/kubernetes/git/refs{/sha}","trees_url":"https://api.github.com/repos/kubernetes/kubernetes/git/trees{/sha}","statuses_url":"https://api.github.com/repos/kubernetes/kubernetes/statuses/{sha}","languages_url":"https://api.github.com/repos/kubernetes/kubernetes/languages","stargazers_url":"https://api.github.com/repos/kubernetes/kubernetes/stargazers","contributors_url":"https://api.github.com/repos/kubernetes/kubernetes/contributors","subscribers_url":"https://api.github.com/repos/kubernetes/kubernetes/subscribers","subscription_url":"https://api.github.com/repos/kubernetes/kubernetes/subscription","commits_url":"https://api.github.com/repos/kubernetes/kubernetes/commits{/sha}","git_commits_url":"https://api.github.com/repos/kubernetes/kubernetes/git/commits{/sha}","comments_url":"https://api.github.com/repos/kubernetes/kubernetes/comments{/number}","issue_comment_url":"https://api.github.com/repos/kubernetes/kubernetes/issues/comments{/number}","contents_url":"https://api.github.com/repos/kubernetes/kubernetes/contents/{+path}","compare_url":"https://api.github.com/repos/kubernetes/kubernetes/compare/{base}...{head}","merges_url":"https://api.github.com/repos/kubernetes/kubernetes/merges","archive_url":"https://api.github.com/repos/kubernetes/kubernetes/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/kubernetes/kubernetes/downloads","issues_url":"https://api.github.com/repos/kubernetes/kubernetes/issues{/number}","pulls_url":"https://api.github.com/repos/kubernetes/kubernetes/pulls{/number}","milestones_url":"https://api.github.com/repos/kubernetes/kubernetes/milestones{/number}","notifications_url":"https://api.github.com/repos/kubernetes/kubernetes/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/kubernetes/kubernetes/labels{/name}","releases_url":"https://api.github.com/repos/kubernetes/kubernetes/releases{/id}","created_at":"2014-06-06T22:56:04Z","updated_at":"2015-11-04T09:16:10Z","pushed_at":"2015-11-04T09:33:36Z","git_url":"git://github.com/kubernetes/kubernetes.git","ssh_url":"git@github.com:kubernetes/kubernetes.git","clone_url":"https://github.com/kubernetes/kubernetes.git","svn_url":"https://github.com/kubernetes/kubernetes","homepage":"http://kubernetes.io","size":524627,"stargazers_count":11040,"watchers_count":11040,"language":"Go","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":true,"forks_count":2860,"mirror_url":null,"open_issues_count":2171,"forks":2860,"open_issues":2171,"watchers":11040,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/kubernetes/kubernetes/pulls/16610"},"html":{"href":"https://github.com/kubernetes/kubernetes/pull/16610"},"issue":{"href":"https://api.github.com/repos/kubernetes/kubernetes/issues/16610"},"comments":{"href":"https://api.github.com/repos/kubernetes/kubernetes/issues/16610/comments"},"review_comments":{"href":"https://api.github.com/repos/kubernetes/kubernetes/pulls/16610/comments"},"review_comment":{"href":"https://api.github.com/repos/kubernetes/kubernetes/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/kubernetes/kubernetes/pulls/16610/commits"},"statuses":{"href":"https://api.github.com/repos/kubernetes/kubernetes/statuses/88e4206d339a718cab2175135cc4ad687bce08b9"}}}}