{"action":"created","comment":{"url":"https://api.github.com/repos/DaoCloud/ingress-nginx/pulls/comments/239377052","pull_request_review_id":182142594,"id":239377052,"node_id":"MDI0OlB1bGxSZXF1ZXN0UmV2aWV3Q29tbWVudDIzOTM3NzA1Mg==","diff_hunk":"@@ -0,0 +1,52 @@\n+local util = require(\"util\")\n+local configuration = require(\"ab_configuration\")\n+local header_diversion = require(\"diversion.header\")\n+\n+\n+\n+local _M = {}\n+\n+local function get_upstream()\n+  local policies = configuration.get_policies()\n+  if not policies then\n+    return\n+  end\n+\n+  local server_path = string.format(\"%s%s\", ngx.var.host, ngx.var.location_path)","path":"rootfs/etc/nginx/lua/diversion.lua","position":15,"original_position":15,"commit_id":"863ae202f398c18a55f7f15ceb53e2d1e9f87b66","original_commit_id":"863ae202f398c18a55f7f15ceb53e2d1e9f87b66","user":{"login":"tianyuansun","id":31433937,"node_id":"MDQ6VXNlcjMxNDMzOTM3","avatar_url":"https://avatars1.githubusercontent.com/u/31433937?v=4","gravatar_id":"","url":"https://api.github.com/users/tianyuansun","html_url":"https://github.com/tianyuansun","followers_url":"https://api.github.com/users/tianyuansun/followers","following_url":"https://api.github.com/users/tianyuansun/following{/other_user}","gists_url":"https://api.github.com/users/tianyuansun/gists{/gist_id}","starred_url":"https://api.github.com/users/tianyuansun/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tianyuansun/subscriptions","organizations_url":"https://api.github.com/users/tianyuansun/orgs","repos_url":"https://api.github.com/users/tianyuansun/repos","events_url":"https://api.github.com/users/tianyuansun/events{/privacy}","received_events_url":"https://api.github.com/users/tianyuansun/received_events","type":"User","site_admin":false},"body":"就是最早提的看一下 balancer 和 upstream 的 sync 那一部分的 lua 代码","created_at":"2018-12-06T09:19:19Z","updated_at":"2018-12-06T09:20:02Z","html_url":"https://github.com/DaoCloud/ingress-nginx/pull/6#discussion_r239377052","pull_request_url":"https://api.github.com/repos/DaoCloud/ingress-nginx/pulls/6","author_association":"NONE","_links":{"self":{"href":"https://api.github.com/repos/DaoCloud/ingress-nginx/pulls/comments/239377052"},"html":{"href":"https://github.com/DaoCloud/ingress-nginx/pull/6#discussion_r239377052"},"pull_request":{"href":"https://api.github.com/repos/DaoCloud/ingress-nginx/pulls/6"}},"in_reply_to_id":239354234},"pull_request":{"url":"https://api.github.com/repos/DaoCloud/ingress-nginx/pulls/6","id":235705942,"node_id":"MDExOlB1bGxSZXF1ZXN0MjM1NzA1OTQy","html_url":"https://github.com/DaoCloud/ingress-nginx/pull/6","diff_url":"https://github.com/DaoCloud/ingress-nginx/pull/6.diff","patch_url":"https://github.com/DaoCloud/ingress-nginx/pull/6.patch","issue_url":"https://api.github.com/repos/DaoCloud/ingress-nginx/issues/6","number":6,"state":"open","locked":false,"title":"Feature/traffic shaping policy","user":{"login":"yowenter","id":6657718,"node_id":"MDQ6VXNlcjY2NTc3MTg=","avatar_url":"https://avatars3.githubusercontent.com/u/6657718?v=4","gravatar_id":"","url":"https://api.github.com/users/yowenter","html_url":"https://github.com/yowenter","followers_url":"https://api.github.com/users/yowenter/followers","following_url":"https://api.github.com/users/yowenter/following{/other_user}","gists_url":"https://api.github.com/users/yowenter/gists{/gist_id}","starred_url":"https://api.github.com/users/yowenter/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/yowenter/subscriptions","organizations_url":"https://api.github.com/users/yowenter/orgs","repos_url":"https://api.github.com/users/yowenter/repos","events_url":"https://api.github.com/users/yowenter/events{/privacy}","received_events_url":"https://api.github.com/users/yowenter/received_events","type":"User","site_admin":false},"body":"流量切分开发\r\n\r\n- [x] Lua traffic shaping by header\r\n- [ ] Lua traffic shaping by ip range\r\n- [ ] Lua traffic shaping by weight \r\n- [x] Lua traffic shaping policy admin api\r\n- [x] Ingress Controller  parse  ingress yaml annotations.  ","created_at":"2018-12-04T07:31:23Z","updated_at":"2018-12-06T09:20:01Z","closed_at":null,"merged_at":null,"merge_commit_sha":"29ee29a1974888a58567e0c6ed419dea8286da60","assignee":{"login":"tianyuansun","id":31433937,"node_id":"MDQ6VXNlcjMxNDMzOTM3","avatar_url":"https://avatars1.githubusercontent.com/u/31433937?v=4","gravatar_id":"","url":"https://api.github.com/users/tianyuansun","html_url":"https://github.com/tianyuansun","followers_url":"https://api.github.com/users/tianyuansun/followers","following_url":"https://api.github.com/users/tianyuansun/following{/other_user}","gists_url":"https://api.github.com/users/tianyuansun/gists{/gist_id}","starred_url":"https://api.github.com/users/tianyuansun/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tianyuansun/subscriptions","organizations_url":"https://api.github.com/users/tianyuansun/orgs","repos_url":"https://api.github.com/users/tianyuansun/repos","events_url":"https://api.github.com/users/tianyuansun/events{/privacy}","received_events_url":"https://api.github.com/users/tianyuansun/received_events","type":"User","site_admin":false},"assignees":[{"login":"tianyuansun","id":31433937,"node_id":"MDQ6VXNlcjMxNDMzOTM3","avatar_url":"https://avatars1.githubusercontent.com/u/31433937?v=4","gravatar_id":"","url":"https://api.github.com/users/tianyuansun","html_url":"https://github.com/tianyuansun","followers_url":"https://api.github.com/users/tianyuansun/followers","following_url":"https://api.github.com/users/tianyuansun/following{/other_user}","gists_url":"https://api.github.com/users/tianyuansun/gists{/gist_id}","starred_url":"https://api.github.com/users/tianyuansun/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tianyuansun/subscriptions","organizations_url":"https://api.github.com/users/tianyuansun/orgs","repos_url":"https://api.github.com/users/tianyuansun/repos","events_url":"https://api.github.com/users/tianyuansun/events{/privacy}","received_events_url":"https://api.github.com/users/tianyuansun/received_events","type":"User","site_admin":false}],"requested_reviewers":[{"login":"pacoxu","id":2010320,"node_id":"MDQ6VXNlcjIwMTAzMjA=","avatar_url":"https://avatars3.githubusercontent.com/u/2010320?v=4","gravatar_id":"","url":"https://api.github.com/users/pacoxu","html_url":"https://github.com/pacoxu","followers_url":"https://api.github.com/users/pacoxu/followers","following_url":"https://api.github.com/users/pacoxu/following{/other_user}","gists_url":"https://api.github.com/users/pacoxu/gists{/gist_id}","starred_url":"https://api.github.com/users/pacoxu/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/pacoxu/subscriptions","organizations_url":"https://api.github.com/users/pacoxu/orgs","repos_url":"https://api.github.com/users/pacoxu/repos","events_url":"https://api.github.com/users/pacoxu/events{/privacy}","received_events_url":"https://api.github.com/users/pacoxu/received_events","type":"User","site_admin":false}],"requested_teams":[],"labels":[],"milestone":null,"commits_url":"https://api.github.com/repos/DaoCloud/ingress-nginx/pulls/6/commits","review_comments_url":"https://api.github.com/repos/DaoCloud/ingress-nginx/pulls/6/comments","review_comment_url":"https://api.github.com/repos/DaoCloud/ingress-nginx/pulls/comments{/number}","comments_url":"https://api.github.com/repos/DaoCloud/ingress-nginx/issues/6/comments","statuses_url":"https://api.github.com/repos/DaoCloud/ingress-nginx/statuses/863ae202f398c18a55f7f15ceb53e2d1e9f87b66","head":{"label":"yowenter:feature/traffic-shaping-policy","ref":"feature/traffic-shaping-policy","sha":"863ae202f398c18a55f7f15ceb53e2d1e9f87b66","user":{"login":"yowenter","id":6657718,"node_id":"MDQ6VXNlcjY2NTc3MTg=","avatar_url":"https://avatars3.githubusercontent.com/u/6657718?v=4","gravatar_id":"","url":"https://api.github.com/users/yowenter","html_url":"https://github.com/yowenter","followers_url":"https://api.github.com/users/yowenter/followers","following_url":"https://api.github.com/users/yowenter/following{/other_user}","gists_url":"https://api.github.com/users/yowenter/gists{/gist_id}","starred_url":"https://api.github.com/users/yowenter/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/yowenter/subscriptions","organizations_url":"https://api.github.com/users/yowenter/orgs","repos_url":"https://api.github.com/users/yowenter/repos","events_url":"https://api.github.com/users/yowenter/events{/privacy}","received_events_url":"https://api.github.com/users/yowenter/received_events","type":"User","site_admin":false},"repo":{"id":120433824,"node_id":"MDEwOlJlcG9zaXRvcnkxMjA0MzM4MjQ=","name":"ingress-nginx","full_name":"yowenter/ingress-nginx","private":false,"owner":{"login":"yowenter","id":6657718,"node_id":"MDQ6VXNlcjY2NTc3MTg=","avatar_url":"https://avatars3.githubusercontent.com/u/6657718?v=4","gravatar_id":"","url":"https://api.github.com/users/yowenter","html_url":"https://github.com/yowenter","followers_url":"https://api.github.com/users/yowenter/followers","following_url":"https://api.github.com/users/yowenter/following{/other_user}","gists_url":"https://api.github.com/users/yowenter/gists{/gist_id}","starred_url":"https://api.github.com/users/yowenter/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/yowenter/subscriptions","organizations_url":"https://api.github.com/users/yowenter/orgs","repos_url":"https://api.github.com/users/yowenter/repos","events_url":"https://api.github.com/users/yowenter/events{/privacy}","received_events_url":"https://api.github.com/users/yowenter/received_events","type":"User","site_admin":false},"html_url":"https://github.com/yowenter/ingress-nginx","description":"Ingress controller for nginx","fork":true,"url":"https://api.github.com/repos/yowenter/ingress-nginx","forks_url":"https://api.github.com/repos/yowenter/ingress-nginx/forks","keys_url":"https://api.github.com/repos/yowenter/ingress-nginx/keys{/key_id}","collaborators_url":"https://api.github.com/repos/yowenter/ingress-nginx/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/yowenter/ingress-nginx/teams","hooks_url":"https://api.github.com/repos/yowenter/ingress-nginx/hooks","issue_events_url":"https://api.github.com/repos/yowenter/ingress-nginx/issues/events{/number}","events_url":"https://api.github.com/repos/yowenter/ingress-nginx/events","assignees_url":"https://api.github.com/repos/yowenter/ingress-nginx/assignees{/user}","branches_url":"https://api.github.com/repos/yowenter/ingress-nginx/branches{/branch}","tags_url":"https://api.github.com/repos/yowenter/ingress-nginx/tags","blobs_url":"https://api.github.com/repos/yowenter/ingress-nginx/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/yowenter/ingress-nginx/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/yowenter/ingress-nginx/git/refs{/sha}","trees_url":"https://api.github.com/repos/yowenter/ingress-nginx/git/trees{/sha}","statuses_url":"https://api.github.com/repos/yowenter/ingress-nginx/statuses/{sha}","languages_url":"https://api.github.com/repos/yowenter/ingress-nginx/languages","stargazers_url":"https://api.github.com/repos/yowenter/ingress-nginx/stargazers","contributors_url":"https://api.github.com/repos/yowenter/ingress-nginx/contributors","subscribers_url":"https://api.github.com/repos/yowenter/ingress-nginx/subscribers","subscription_url":"https://api.github.com/repos/yowenter/ingress-nginx/subscription","commits_url":"https://api.github.com/repos/yowenter/ingress-nginx/commits{/sha}","git_commits_url":"https://api.github.com/repos/yowenter/ingress-nginx/git/commits{/sha}","comments_url":"https://api.github.com/repos/yowenter/ingress-nginx/comments{/number}","issue_comment_url":"https://api.github.com/repos/yowenter/ingress-nginx/issues/comments{/number}","contents_url":"https://api.github.com/repos/yowenter/ingress-nginx/contents/{+path}","compare_url":"https://api.github.com/repos/yowenter/ingress-nginx/compare/{base}...{head}","merges_url":"https://api.github.com/repos/yowenter/ingress-nginx/merges","archive_url":"https://api.github.com/repos/yowenter/ingress-nginx/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/yowenter/ingress-nginx/downloads","issues_url":"https://api.github.com/repos/yowenter/ingress-nginx/issues{/number}","pulls_url":"https://api.github.com/repos/yowenter/ingress-nginx/pulls{/number}","milestones_url":"https://api.github.com/repos/yowenter/ingress-nginx/milestones{/number}","notifications_url":"https://api.github.com/repos/yowenter/ingress-nginx/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/yowenter/ingress-nginx/labels{/name}","releases_url":"https://api.github.com/repos/yowenter/ingress-nginx/releases{/id}","deployments_url":"https://api.github.com/repos/yowenter/ingress-nginx/deployments","created_at":"2018-02-06T09:46:06Z","updated_at":"2018-11-29T09:44:50Z","pushed_at":"2018-12-05T13:18:03Z","git_url":"git://github.com/yowenter/ingress-nginx.git","ssh_url":"git@github.com:yowenter/ingress-nginx.git","clone_url":"https://github.com/yowenter/ingress-nginx.git","svn_url":"https://github.com/yowenter/ingress-nginx","homepage":"","size":74340,"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":"DaoCloud:DCE/0.20.x-dev","ref":"DCE/0.20.x-dev","sha":"e8d81034b8f6b3308caac85280e4cf3d93baee1c","user":{"login":"DaoCloud","id":9465053,"node_id":"MDEyOk9yZ2FuaXphdGlvbjk0NjUwNTM=","avatar_url":"https://avatars1.githubusercontent.com/u/9465053?v=4","gravatar_id":"","url":"https://api.github.com/users/DaoCloud","html_url":"https://github.com/DaoCloud","followers_url":"https://api.github.com/users/DaoCloud/followers","following_url":"https://api.github.com/users/DaoCloud/following{/other_user}","gists_url":"https://api.github.com/users/DaoCloud/gists{/gist_id}","starred_url":"https://api.github.com/users/DaoCloud/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/DaoCloud/subscriptions","organizations_url":"https://api.github.com/users/DaoCloud/orgs","repos_url":"https://api.github.com/users/DaoCloud/repos","events_url":"https://api.github.com/users/DaoCloud/events{/privacy}","received_events_url":"https://api.github.com/users/DaoCloud/received_events","type":"Organization","site_admin":false},"repo":{"id":141082294,"node_id":"MDEwOlJlcG9zaXRvcnkxNDEwODIyOTQ=","name":"ingress-nginx","full_name":"DaoCloud/ingress-nginx","private":false,"owner":{"login":"DaoCloud","id":9465053,"node_id":"MDEyOk9yZ2FuaXphdGlvbjk0NjUwNTM=","avatar_url":"https://avatars1.githubusercontent.com/u/9465053?v=4","gravatar_id":"","url":"https://api.github.com/users/DaoCloud","html_url":"https://github.com/DaoCloud","followers_url":"https://api.github.com/users/DaoCloud/followers","following_url":"https://api.github.com/users/DaoCloud/following{/other_user}","gists_url":"https://api.github.com/users/DaoCloud/gists{/gist_id}","starred_url":"https://api.github.com/users/DaoCloud/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/DaoCloud/subscriptions","organizations_url":"https://api.github.com/users/DaoCloud/orgs","repos_url":"https://api.github.com/users/DaoCloud/repos","events_url":"https://api.github.com/users/DaoCloud/events{/privacy}","received_events_url":"https://api.github.com/users/DaoCloud/received_events","type":"Organization","site_admin":false},"html_url":"https://github.com/DaoCloud/ingress-nginx","description":"分支管理: http://dwiki.daocloud.io/pages/viewpage.action?pageId=25563323","fork":true,"url":"https://api.github.com/repos/DaoCloud/ingress-nginx","forks_url":"https://api.github.com/repos/DaoCloud/ingress-nginx/forks","keys_url":"https://api.github.com/repos/DaoCloud/ingress-nginx/keys{/key_id}","collaborators_url":"https://api.github.com/repos/DaoCloud/ingress-nginx/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/DaoCloud/ingress-nginx/teams","hooks_url":"https://api.github.com/repos/DaoCloud/ingress-nginx/hooks","issue_events_url":"https://api.github.com/repos/DaoCloud/ingress-nginx/issues/events{/number}","events_url":"https://api.github.com/repos/DaoCloud/ingress-nginx/events","assignees_url":"https://api.github.com/repos/DaoCloud/ingress-nginx/assignees{/user}","branches_url":"https://api.github.com/repos/DaoCloud/ingress-nginx/branches{/branch}","tags_url":"https://api.github.com/repos/DaoCloud/ingress-nginx/tags","blobs_url":"https://api.github.com/repos/DaoCloud/ingress-nginx/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/DaoCloud/ingress-nginx/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/DaoCloud/ingress-nginx/git/refs{/sha}","trees_url":"https://api.github.com/repos/DaoCloud/ingress-nginx/git/trees{/sha}","statuses_url":"https://api.github.com/repos/DaoCloud/ingress-nginx/statuses/{sha}","languages_url":"https://api.github.com/repos/DaoCloud/ingress-nginx/languages","stargazers_url":"https://api.github.com/repos/DaoCloud/ingress-nginx/stargazers","contributors_url":"https://api.github.com/repos/DaoCloud/ingress-nginx/contributors","subscribers_url":"https://api.github.com/repos/DaoCloud/ingress-nginx/subscribers","subscription_url":"https://api.github.com/repos/DaoCloud/ingress-nginx/subscription","commits_url":"https://api.github.com/repos/DaoCloud/ingress-nginx/commits{/sha}","git_commits_url":"https://api.github.com/repos/DaoCloud/ingress-nginx/git/commits{/sha}","comments_url":"https://api.github.com/repos/DaoCloud/ingress-nginx/comments{/number}","issue_comment_url":"https://api.github.com/repos/DaoCloud/ingress-nginx/issues/comments{/number}","contents_url":"https://api.github.com/repos/DaoCloud/ingress-nginx/contents/{+path}","compare_url":"https://api.github.com/repos/DaoCloud/ingress-nginx/compare/{base}...{head}","merges_url":"https://api.github.com/repos/DaoCloud/ingress-nginx/merges","archive_url":"https://api.github.com/repos/DaoCloud/ingress-nginx/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/DaoCloud/ingress-nginx/downloads","issues_url":"https://api.github.com/repos/DaoCloud/ingress-nginx/issues{/number}","pulls_url":"https://api.github.com/repos/DaoCloud/ingress-nginx/pulls{/number}","milestones_url":"https://api.github.com/repos/DaoCloud/ingress-nginx/milestones{/number}","notifications_url":"https://api.github.com/repos/DaoCloud/ingress-nginx/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/DaoCloud/ingress-nginx/labels{/name}","releases_url":"https://api.github.com/repos/DaoCloud/ingress-nginx/releases{/id}","deployments_url":"https://api.github.com/repos/DaoCloud/ingress-nginx/deployments","created_at":"2018-07-16T03:30:53Z","updated_at":"2018-12-04T15:13:15Z","pushed_at":"2018-12-05T13:18:05Z","git_url":"git://github.com/DaoCloud/ingress-nginx.git","ssh_url":"git@github.com:DaoCloud/ingress-nginx.git","clone_url":"https://github.com/DaoCloud/ingress-nginx.git","svn_url":"https://github.com/DaoCloud/ingress-nginx","homepage":"","size":75529,"stargazers_count":2,"watchers_count":2,"language":"Go","has_issues":false,"has_projects":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":0,"mirror_url":null,"archived":false,"open_issues_count":1,"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":1,"watchers":2,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/DaoCloud/ingress-nginx/pulls/6"},"html":{"href":"https://github.com/DaoCloud/ingress-nginx/pull/6"},"issue":{"href":"https://api.github.com/repos/DaoCloud/ingress-nginx/issues/6"},"comments":{"href":"https://api.github.com/repos/DaoCloud/ingress-nginx/issues/6/comments"},"review_comments":{"href":"https://api.github.com/repos/DaoCloud/ingress-nginx/pulls/6/comments"},"review_comment":{"href":"https://api.github.com/repos/DaoCloud/ingress-nginx/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/DaoCloud/ingress-nginx/pulls/6/commits"},"statuses":{"href":"https://api.github.com/repos/DaoCloud/ingress-nginx/statuses/863ae202f398c18a55f7f15ceb53e2d1e9f87b66"}},"author_association":"NONE"}}
{"actor":{"display_login":"tianyuansun"}}