{"action":"created","comment":{"url":"https://api.github.com/repos/rancher/webhook-service/pulls/comments/90911656","pull_request_review_id":11410367,"id":90911656,"diff_hunk":"@@ -4,39 +4,20 @@ import (\n \t\"fmt\"\n \t\"github.com/pkg/errors\"\n \t\"github.com/rancher/go-rancher/v2\"\n-\t\"github.com/rancher/rancher-auth-service/util\"\n+\t\"github.com/rancher/webhook-service/config\"\n \t\"net/http\"\n \t\"time\"\n )\n \n //WebhookDriver interface for all drivers\n type WebhookDriver interface {\n-\tConstructPayload(input map[string]interface{}) (map[string]interface{}, error)\n-\tExecute(payload map[string]interface{}) (int, map[string]interface{}, error)\n+\tExecute(payload map[string]interface{}, envConfig config.Config) (int, map[string]interface{}, error)","path":"drivers/driver_functions.go","position":14,"original_position":14,"commit_id":"56c47bcac643e87fbf9c5fc37507caad7a63b453","original_commit_id":"56c47bcac643e87fbf9c5fc37507caad7a63b453","user":{"login":"cjellick","id":2473240,"avatar_url":"https://avatars.githubusercontent.com/u/2473240?v=3","gravatar_id":"","url":"https://api.github.com/users/cjellick","html_url":"https://github.com/cjellick","followers_url":"https://api.github.com/users/cjellick/followers","following_url":"https://api.github.com/users/cjellick/following{/other_user}","gists_url":"https://api.github.com/users/cjellick/gists{/gist_id}","starred_url":"https://api.github.com/users/cjellick/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/cjellick/subscriptions","organizations_url":"https://api.github.com/users/cjellick/orgs","repos_url":"https://api.github.com/users/cjellick/repos","events_url":"https://api.github.com/users/cjellick/events{/privacy}","received_events_url":"https://api.github.com/users/cjellick/received_events","type":"User","site_admin":false},"body":"I think we need to change this to pass the rancher client in as a parameter to Execute. The reasons for this are that\r\n1. We don't want the drivers to have to know the details of how to create clients because this makes drivers harder to implement.\r\n2. We want the framework to be able to manage clients so that we can address the resource leak in a single place.","created_at":"2016-12-05T17:16:38Z","updated_at":"2016-12-05T17:16:38Z","html_url":"https://github.com/rancher/webhook-service/pull/5#discussion_r90911656","pull_request_url":"https://api.github.com/repos/rancher/webhook-service/pulls/5","_links":{"self":{"href":"https://api.github.com/repos/rancher/webhook-service/pulls/comments/90911656"},"html":{"href":"https://github.com/rancher/webhook-service/pull/5#discussion_r90911656"},"pull_request":{"href":"https://api.github.com/repos/rancher/webhook-service/pulls/5"}}},"pull_request":{"url":"https://api.github.com/repos/rancher/webhook-service/pulls/5","id":96232814,"html_url":"https://github.com/rancher/webhook-service/pull/5","diff_url":"https://github.com/rancher/webhook-service/pull/5.diff","patch_url":"https://github.com/rancher/webhook-service/pull/5.patch","issue_url":"https://api.github.com/repos/rancher/webhook-service/issues/5","number":5,"state":"open","locked":false,"title":"Url, accountID and Schemas","user":{"login":"mrajashree","id":10672776,"avatar_url":"https://avatars.githubusercontent.com/u/10672776?v=3","gravatar_id":"","url":"https://api.github.com/users/mrajashree","html_url":"https://github.com/mrajashree","followers_url":"https://api.github.com/users/mrajashree/followers","following_url":"https://api.github.com/users/mrajashree/following{/other_user}","gists_url":"https://api.github.com/users/mrajashree/gists{/gist_id}","starred_url":"https://api.github.com/users/mrajashree/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mrajashree/subscriptions","organizations_url":"https://api.github.com/users/mrajashree/orgs","repos_url":"https://api.github.com/users/mrajashree/repos","events_url":"https://api.github.com/users/mrajashree/events{/privacy}","received_events_url":"https://api.github.com/users/mrajashree/received_events","type":"User","site_admin":false},"body":"This PR 1) returns URL of format `proto`://`host`/v1-webhooks-receiver?token=`jwt`\r\n2) Refactors accountID out of payload and passes as a parameter\r\n3) Removes separate function for ScaleService and puts the logic in Execute\r\n4) Schemas working\r\n5) Env vars are no longer global","created_at":"2016-12-02T07:20:46Z","updated_at":"2016-12-05T17:21:21Z","closed_at":null,"merged_at":null,"merge_commit_sha":"20f78dcf15f5c88d24c38557ce51490e1bb6984c","assignee":null,"assignees":[],"milestone":null,"commits_url":"https://api.github.com/repos/rancher/webhook-service/pulls/5/commits","review_comments_url":"https://api.github.com/repos/rancher/webhook-service/pulls/5/comments","review_comment_url":"https://api.github.com/repos/rancher/webhook-service/pulls/comments{/number}","comments_url":"https://api.github.com/repos/rancher/webhook-service/issues/5/comments","statuses_url":"https://api.github.com/repos/rancher/webhook-service/statuses/56c47bcac643e87fbf9c5fc37507caad7a63b453","head":{"label":"mrajashree:framework_changes","ref":"framework_changes","sha":"56c47bcac643e87fbf9c5fc37507caad7a63b453","user":{"login":"mrajashree","id":10672776,"avatar_url":"https://avatars.githubusercontent.com/u/10672776?v=3","gravatar_id":"","url":"https://api.github.com/users/mrajashree","html_url":"https://github.com/mrajashree","followers_url":"https://api.github.com/users/mrajashree/followers","following_url":"https://api.github.com/users/mrajashree/following{/other_user}","gists_url":"https://api.github.com/users/mrajashree/gists{/gist_id}","starred_url":"https://api.github.com/users/mrajashree/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mrajashree/subscriptions","organizations_url":"https://api.github.com/users/mrajashree/orgs","repos_url":"https://api.github.com/users/mrajashree/repos","events_url":"https://api.github.com/users/mrajashree/events{/privacy}","received_events_url":"https://api.github.com/users/mrajashree/received_events","type":"User","site_admin":false},"repo":{"id":73122587,"name":"webhook-service","full_name":"mrajashree/webhook-service","owner":{"login":"mrajashree","id":10672776,"avatar_url":"https://avatars.githubusercontent.com/u/10672776?v=3","gravatar_id":"","url":"https://api.github.com/users/mrajashree","html_url":"https://github.com/mrajashree","followers_url":"https://api.github.com/users/mrajashree/followers","following_url":"https://api.github.com/users/mrajashree/following{/other_user}","gists_url":"https://api.github.com/users/mrajashree/gists{/gist_id}","starred_url":"https://api.github.com/users/mrajashree/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mrajashree/subscriptions","organizations_url":"https://api.github.com/users/mrajashree/orgs","repos_url":"https://api.github.com/users/mrajashree/repos","events_url":"https://api.github.com/users/mrajashree/events{/privacy}","received_events_url":"https://api.github.com/users/mrajashree/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/mrajashree/webhook-service","description":"Service for constructing and processing ","fork":true,"url":"https://api.github.com/repos/mrajashree/webhook-service","forks_url":"https://api.github.com/repos/mrajashree/webhook-service/forks","keys_url":"https://api.github.com/repos/mrajashree/webhook-service/keys{/key_id}","collaborators_url":"https://api.github.com/repos/mrajashree/webhook-service/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/mrajashree/webhook-service/teams","hooks_url":"https://api.github.com/repos/mrajashree/webhook-service/hooks","issue_events_url":"https://api.github.com/repos/mrajashree/webhook-service/issues/events{/number}","events_url":"https://api.github.com/repos/mrajashree/webhook-service/events","assignees_url":"https://api.github.com/repos/mrajashree/webhook-service/assignees{/user}","branches_url":"https://api.github.com/repos/mrajashree/webhook-service/branches{/branch}","tags_url":"https://api.github.com/repos/mrajashree/webhook-service/tags","blobs_url":"https://api.github.com/repos/mrajashree/webhook-service/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/mrajashree/webhook-service/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/mrajashree/webhook-service/git/refs{/sha}","trees_url":"https://api.github.com/repos/mrajashree/webhook-service/git/trees{/sha}","statuses_url":"https://api.github.com/repos/mrajashree/webhook-service/statuses/{sha}","languages_url":"https://api.github.com/repos/mrajashree/webhook-service/languages","stargazers_url":"https://api.github.com/repos/mrajashree/webhook-service/stargazers","contributors_url":"https://api.github.com/repos/mrajashree/webhook-service/contributors","subscribers_url":"https://api.github.com/repos/mrajashree/webhook-service/subscribers","subscription_url":"https://api.github.com/repos/mrajashree/webhook-service/subscription","commits_url":"https://api.github.com/repos/mrajashree/webhook-service/commits{/sha}","git_commits_url":"https://api.github.com/repos/mrajashree/webhook-service/git/commits{/sha}","comments_url":"https://api.github.com/repos/mrajashree/webhook-service/comments{/number}","issue_comment_url":"https://api.github.com/repos/mrajashree/webhook-service/issues/comments{/number}","contents_url":"https://api.github.com/repos/mrajashree/webhook-service/contents/{+path}","compare_url":"https://api.github.com/repos/mrajashree/webhook-service/compare/{base}...{head}","merges_url":"https://api.github.com/repos/mrajashree/webhook-service/merges","archive_url":"https://api.github.com/repos/mrajashree/webhook-service/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/mrajashree/webhook-service/downloads","issues_url":"https://api.github.com/repos/mrajashree/webhook-service/issues{/number}","pulls_url":"https://api.github.com/repos/mrajashree/webhook-service/pulls{/number}","milestones_url":"https://api.github.com/repos/mrajashree/webhook-service/milestones{/number}","notifications_url":"https://api.github.com/repos/mrajashree/webhook-service/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/mrajashree/webhook-service/labels{/name}","releases_url":"https://api.github.com/repos/mrajashree/webhook-service/releases{/id}","deployments_url":"https://api.github.com/repos/mrajashree/webhook-service/deployments","created_at":"2016-11-07T21:29:50Z","updated_at":"2016-11-07T23:29:35Z","pushed_at":"2016-12-03T01:27:18Z","git_url":"git://github.com/mrajashree/webhook-service.git","ssh_url":"git@github.com:mrajashree/webhook-service.git","clone_url":"https://github.com/mrajashree/webhook-service.git","svn_url":"https://github.com/mrajashree/webhook-service","homepage":null,"size":3632,"stargazers_count":1,"watchers_count":1,"language":"Shell","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":1,"default_branch":"master"}},"base":{"label":"rancher:master","ref":"master","sha":"9281ceb1d8eab918f3e48bf0ab88b97e67ed13c1","user":{"login":"rancher","id":9343010,"avatar_url":"https://avatars.githubusercontent.com/u/9343010?v=3","gravatar_id":"","url":"https://api.github.com/users/rancher","html_url":"https://github.com/rancher","followers_url":"https://api.github.com/users/rancher/followers","following_url":"https://api.github.com/users/rancher/following{/other_user}","gists_url":"https://api.github.com/users/rancher/gists{/gist_id}","starred_url":"https://api.github.com/users/rancher/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rancher/subscriptions","organizations_url":"https://api.github.com/users/rancher/orgs","repos_url":"https://api.github.com/users/rancher/repos","events_url":"https://api.github.com/users/rancher/events{/privacy}","received_events_url":"https://api.github.com/users/rancher/received_events","type":"Organization","site_admin":false},"repo":{"id":72877710,"name":"webhook-service","full_name":"rancher/webhook-service","owner":{"login":"rancher","id":9343010,"avatar_url":"https://avatars.githubusercontent.com/u/9343010?v=3","gravatar_id":"","url":"https://api.github.com/users/rancher","html_url":"https://github.com/rancher","followers_url":"https://api.github.com/users/rancher/followers","following_url":"https://api.github.com/users/rancher/following{/other_user}","gists_url":"https://api.github.com/users/rancher/gists{/gist_id}","starred_url":"https://api.github.com/users/rancher/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rancher/subscriptions","organizations_url":"https://api.github.com/users/rancher/orgs","repos_url":"https://api.github.com/users/rancher/repos","events_url":"https://api.github.com/users/rancher/events{/privacy}","received_events_url":"https://api.github.com/users/rancher/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/rancher/webhook-service","description":"Service for constructing and processing ","fork":false,"url":"https://api.github.com/repos/rancher/webhook-service","forks_url":"https://api.github.com/repos/rancher/webhook-service/forks","keys_url":"https://api.github.com/repos/rancher/webhook-service/keys{/key_id}","collaborators_url":"https://api.github.com/repos/rancher/webhook-service/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/rancher/webhook-service/teams","hooks_url":"https://api.github.com/repos/rancher/webhook-service/hooks","issue_events_url":"https://api.github.com/repos/rancher/webhook-service/issues/events{/number}","events_url":"https://api.github.com/repos/rancher/webhook-service/events","assignees_url":"https://api.github.com/repos/rancher/webhook-service/assignees{/user}","branches_url":"https://api.github.com/repos/rancher/webhook-service/branches{/branch}","tags_url":"https://api.github.com/repos/rancher/webhook-service/tags","blobs_url":"https://api.github.com/repos/rancher/webhook-service/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/rancher/webhook-service/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/rancher/webhook-service/git/refs{/sha}","trees_url":"https://api.github.com/repos/rancher/webhook-service/git/trees{/sha}","statuses_url":"https://api.github.com/repos/rancher/webhook-service/statuses/{sha}","languages_url":"https://api.github.com/repos/rancher/webhook-service/languages","stargazers_url":"https://api.github.com/repos/rancher/webhook-service/stargazers","contributors_url":"https://api.github.com/repos/rancher/webhook-service/contributors","subscribers_url":"https://api.github.com/repos/rancher/webhook-service/subscribers","subscription_url":"https://api.github.com/repos/rancher/webhook-service/subscription","commits_url":"https://api.github.com/repos/rancher/webhook-service/commits{/sha}","git_commits_url":"https://api.github.com/repos/rancher/webhook-service/git/commits{/sha}","comments_url":"https://api.github.com/repos/rancher/webhook-service/comments{/number}","issue_comment_url":"https://api.github.com/repos/rancher/webhook-service/issues/comments{/number}","contents_url":"https://api.github.com/repos/rancher/webhook-service/contents/{+path}","compare_url":"https://api.github.com/repos/rancher/webhook-service/compare/{base}...{head}","merges_url":"https://api.github.com/repos/rancher/webhook-service/merges","archive_url":"https://api.github.com/repos/rancher/webhook-service/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/rancher/webhook-service/downloads","issues_url":"https://api.github.com/repos/rancher/webhook-service/issues{/number}","pulls_url":"https://api.github.com/repos/rancher/webhook-service/pulls{/number}","milestones_url":"https://api.github.com/repos/rancher/webhook-service/milestones{/number}","notifications_url":"https://api.github.com/repos/rancher/webhook-service/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/rancher/webhook-service/labels{/name}","releases_url":"https://api.github.com/repos/rancher/webhook-service/releases{/id}","deployments_url":"https://api.github.com/repos/rancher/webhook-service/deployments","created_at":"2016-11-04T19:10:52Z","updated_at":"2016-12-01T21:21:17Z","pushed_at":"2016-12-03T01:27:18Z","git_url":"git://github.com/rancher/webhook-service.git","ssh_url":"git@github.com:rancher/webhook-service.git","clone_url":"https://github.com/rancher/webhook-service.git","svn_url":"https://github.com/rancher/webhook-service","homepage":null,"size":3630,"stargazers_count":1,"watchers_count":1,"language":"Go","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":2,"mirror_url":null,"open_issues_count":1,"forks":2,"open_issues":1,"watchers":1,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/rancher/webhook-service/pulls/5"},"html":{"href":"https://github.com/rancher/webhook-service/pull/5"},"issue":{"href":"https://api.github.com/repos/rancher/webhook-service/issues/5"},"comments":{"href":"https://api.github.com/repos/rancher/webhook-service/issues/5/comments"},"review_comments":{"href":"https://api.github.com/repos/rancher/webhook-service/pulls/5/comments"},"review_comment":{"href":"https://api.github.com/repos/rancher/webhook-service/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/rancher/webhook-service/pulls/5/commits"},"statuses":{"href":"https://api.github.com/repos/rancher/webhook-service/statuses/56c47bcac643e87fbf9c5fc37507caad7a63b453"}}}}
{"actor":{"display_login":"cjellick"}}