{"action":"created","comment":{"url":"https://api.github.com/repos/kubeless/kubeless/pulls/comments/181952017","pull_request_review_id":112665779,"id":181952017,"diff_hunk":"@@ -0,0 +1,179 @@\n+/*\n+Copyright (c) 2016-2017 Bitnami\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 nats\n+\n+import (\n+\t\"encoding/json\"\n+\t\"fmt\"\n+\t\"net/http\"\n+\t\"os\"\n+\t\"strconv\"\n+\t\"strings\"\n+\t\"time\"\n+\n+\t\"github.com/kubeless/kubeless/pkg/utils\"\n+\t\"github.com/nats-io/go-nats\"\n+\t\"github.com/sirupsen/logrus\"\n+\tmetav1 \"k8s.io/apimachinery/pkg/apis/meta/v1\"\n+\t\"k8s.io/client-go/kubernetes\"\n+)\n+\n+var (\n+\tstopM     map[string](chan struct{})\n+\tstoppedM  map[string](chan struct{})\n+\tconsumerM map[string]bool","path":"pkg/event-consumers/nats/nats-consumer.go","position":null,"original_position":38,"commit_id":"a3b0ccda6a74c857b2ddaf48c0ea38eb09556cde","original_commit_id":"06907bdebbc6e10fa2b7aff4c0ac728ce38f3d27","user":{"login":"murali-reddy","id":2202956,"avatar_url":"https://avatars2.githubusercontent.com/u/2202956?v=4","gravatar_id":"","url":"https://api.github.com/users/murali-reddy","html_url":"https://github.com/murali-reddy","followers_url":"https://api.github.com/users/murali-reddy/followers","following_url":"https://api.github.com/users/murali-reddy/following{/other_user}","gists_url":"https://api.github.com/users/murali-reddy/gists{/gist_id}","starred_url":"https://api.github.com/users/murali-reddy/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/murali-reddy/subscriptions","organizations_url":"https://api.github.com/users/murali-reddy/orgs","repos_url":"https://api.github.com/users/murali-reddy/repos","events_url":"https://api.github.com/users/murali-reddy/events{/privacy}","received_events_url":"https://api.github.com/users/murali-reddy/received_events","type":"User","site_admin":false},"body":"Added locking there is a remote chance of race condition. ","created_at":"2018-04-17T04:55:49Z","updated_at":"2018-04-17T04:55:49Z","html_url":"https://github.com/kubeless/kubeless/pull/689#discussion_r181952017","pull_request_url":"https://api.github.com/repos/kubeless/kubeless/pulls/689","author_association":"CONTRIBUTOR","_links":{"self":{"href":"https://api.github.com/repos/kubeless/kubeless/pulls/comments/181952017"},"html":{"href":"https://github.com/kubeless/kubeless/pull/689#discussion_r181952017"},"pull_request":{"href":"https://api.github.com/repos/kubeless/kubeless/pulls/689"}},"in_reply_to_id":181344958},"pull_request":{"url":"https://api.github.com/repos/kubeless/kubeless/pulls/689","id":181110884,"html_url":"https://github.com/kubeless/kubeless/pull/689","diff_url":"https://github.com/kubeless/kubeless/pull/689.diff","patch_url":"https://github.com/kubeless/kubeless/pull/689.patch","issue_url":"https://api.github.com/repos/kubeless/kubeless/issues/689","number":689,"state":"open","locked":false,"title":"add NATS support","user":{"login":"murali-reddy","id":2202956,"avatar_url":"https://avatars2.githubusercontent.com/u/2202956?v=4","gravatar_id":"","url":"https://api.github.com/users/murali-reddy","html_url":"https://github.com/murali-reddy","followers_url":"https://api.github.com/users/murali-reddy/followers","following_url":"https://api.github.com/users/murali-reddy/following{/other_user}","gists_url":"https://api.github.com/users/murali-reddy/gists{/gist_id}","starred_url":"https://api.github.com/users/murali-reddy/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/murali-reddy/subscriptions","organizations_url":"https://api.github.com/users/murali-reddy/orgs","repos_url":"https://api.github.com/users/murali-reddy/repos","events_url":"https://api.github.com/users/murali-reddy/events{/privacy}","received_events_url":"https://api.github.com/users/murali-reddy/received_events","type":"User","site_admin":false},"body":"**Issue Ref**: #669 \r\n \r\n**Description**: \r\n\r\nAdd NATS support into Kubeless.\r\n\r\n[PR Description]\r\n\r\nThis PR adds a first-cut integration of NATS into Kubeless. NATS provides wide variety of messaging options, this PR adds suport for https://nats.io/documentation/concepts/nats-queueing/\r\n\r\nPlease see the documentation included in the PR on how to use the functionality.\r\n\r\nTo the reviewer:\r\n\r\nCommits are logically organised to make easier to follow.\r\n```\r\n8a38f8c6cb546cdbac8b3899f96341adc3e02fb9 (HEAD -> nats, origin/nats) NATS documentation\r\n0fdb77e3f517c45fe5c74c978cbaa9fbb3bec9b7 fix tests\r\n085e38f501126216c941ce3fb18194d0487444d7 build, CI and other misc stuff\r\n0868bc84656ec1ff58955e5f3514609561232303 CLI support for NATS\r\n90427b67f07810b9cc6df43c510bf11e3648c25d core nats trigger functionality\r\n2254359450820910968bdd54646ffae72fa4f563 auto-generated code from code generator\r\nb904a1d33d1fe325becfb8db380fee85ac6f607b API spec for nats trigger\r\n2345b2a614c304adffd927aede296ad5caaf8e7a vendor nats-io/go-nats and nats-io/nuid\r\n```\r\n\r\n**TODOs**:\r\n - [x] Ready to review\r\n - [x] Automated Tests\r\n - [x] Docs\r\n\r\nPlanning to add some more IT tests, but PR is good to get started with review.","created_at":"2018-04-12T07:20:05Z","updated_at":"2018-04-17T04:55:49Z","closed_at":null,"merged_at":null,"merge_commit_sha":"27377e7323b0df2c750a826a9f2d9c2c7a4c5c6b","assignee":null,"assignees":[],"requested_reviewers":[],"requested_teams":[],"labels":[],"milestone":null,"commits_url":"https://api.github.com/repos/kubeless/kubeless/pulls/689/commits","review_comments_url":"https://api.github.com/repos/kubeless/kubeless/pulls/689/comments","review_comment_url":"https://api.github.com/repos/kubeless/kubeless/pulls/comments{/number}","comments_url":"https://api.github.com/repos/kubeless/kubeless/issues/689/comments","statuses_url":"https://api.github.com/repos/kubeless/kubeless/statuses/a3b0ccda6a74c857b2ddaf48c0ea38eb09556cde","head":{"label":"kubeless:nats","ref":"nats","sha":"a3b0ccda6a74c857b2ddaf48c0ea38eb09556cde","user":{"login":"kubeless","id":25339039,"avatar_url":"https://avatars3.githubusercontent.com/u/25339039?v=4","gravatar_id":"","url":"https://api.github.com/users/kubeless","html_url":"https://github.com/kubeless","followers_url":"https://api.github.com/users/kubeless/followers","following_url":"https://api.github.com/users/kubeless/following{/other_user}","gists_url":"https://api.github.com/users/kubeless/gists{/gist_id}","starred_url":"https://api.github.com/users/kubeless/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kubeless/subscriptions","organizations_url":"https://api.github.com/users/kubeless/orgs","repos_url":"https://api.github.com/users/kubeless/repos","events_url":"https://api.github.com/users/kubeless/events{/privacy}","received_events_url":"https://api.github.com/users/kubeless/received_events","type":"Organization","site_admin":false},"repo":{"id":73902337,"name":"kubeless","full_name":"kubeless/kubeless","owner":{"login":"kubeless","id":25339039,"avatar_url":"https://avatars3.githubusercontent.com/u/25339039?v=4","gravatar_id":"","url":"https://api.github.com/users/kubeless","html_url":"https://github.com/kubeless","followers_url":"https://api.github.com/users/kubeless/followers","following_url":"https://api.github.com/users/kubeless/following{/other_user}","gists_url":"https://api.github.com/users/kubeless/gists{/gist_id}","starred_url":"https://api.github.com/users/kubeless/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kubeless/subscriptions","organizations_url":"https://api.github.com/users/kubeless/orgs","repos_url":"https://api.github.com/users/kubeless/repos","events_url":"https://api.github.com/users/kubeless/events{/privacy}","received_events_url":"https://api.github.com/users/kubeless/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/kubeless/kubeless","description":"Kubernetes Native Serverless Framework","fork":false,"url":"https://api.github.com/repos/kubeless/kubeless","forks_url":"https://api.github.com/repos/kubeless/kubeless/forks","keys_url":"https://api.github.com/repos/kubeless/kubeless/keys{/key_id}","collaborators_url":"https://api.github.com/repos/kubeless/kubeless/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/kubeless/kubeless/teams","hooks_url":"https://api.github.com/repos/kubeless/kubeless/hooks","issue_events_url":"https://api.github.com/repos/kubeless/kubeless/issues/events{/number}","events_url":"https://api.github.com/repos/kubeless/kubeless/events","assignees_url":"https://api.github.com/repos/kubeless/kubeless/assignees{/user}","branches_url":"https://api.github.com/repos/kubeless/kubeless/branches{/branch}","tags_url":"https://api.github.com/repos/kubeless/kubeless/tags","blobs_url":"https://api.github.com/repos/kubeless/kubeless/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/kubeless/kubeless/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/kubeless/kubeless/git/refs{/sha}","trees_url":"https://api.github.com/repos/kubeless/kubeless/git/trees{/sha}","statuses_url":"https://api.github.com/repos/kubeless/kubeless/statuses/{sha}","languages_url":"https://api.github.com/repos/kubeless/kubeless/languages","stargazers_url":"https://api.github.com/repos/kubeless/kubeless/stargazers","contributors_url":"https://api.github.com/repos/kubeless/kubeless/contributors","subscribers_url":"https://api.github.com/repos/kubeless/kubeless/subscribers","subscription_url":"https://api.github.com/repos/kubeless/kubeless/subscription","commits_url":"https://api.github.com/repos/kubeless/kubeless/commits{/sha}","git_commits_url":"https://api.github.com/repos/kubeless/kubeless/git/commits{/sha}","comments_url":"https://api.github.com/repos/kubeless/kubeless/comments{/number}","issue_comment_url":"https://api.github.com/repos/kubeless/kubeless/issues/comments{/number}","contents_url":"https://api.github.com/repos/kubeless/kubeless/contents/{+path}","compare_url":"https://api.github.com/repos/kubeless/kubeless/compare/{base}...{head}","merges_url":"https://api.github.com/repos/kubeless/kubeless/merges","archive_url":"https://api.github.com/repos/kubeless/kubeless/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/kubeless/kubeless/downloads","issues_url":"https://api.github.com/repos/kubeless/kubeless/issues{/number}","pulls_url":"https://api.github.com/repos/kubeless/kubeless/pulls{/number}","milestones_url":"https://api.github.com/repos/kubeless/kubeless/milestones{/number}","notifications_url":"https://api.github.com/repos/kubeless/kubeless/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/kubeless/kubeless/labels{/name}","releases_url":"https://api.github.com/repos/kubeless/kubeless/releases{/id}","deployments_url":"https://api.github.com/repos/kubeless/kubeless/deployments","created_at":"2016-11-16T09:03:03Z","updated_at":"2018-04-17T00:02:04Z","pushed_at":"2018-04-16T16:08:05Z","git_url":"git://github.com/kubeless/kubeless.git","ssh_url":"git@github.com:kubeless/kubeless.git","clone_url":"https://github.com/kubeless/kubeless.git","svn_url":"https://github.com/kubeless/kubeless","homepage":"http://kubeless.io","size":63283,"stargazers_count":2315,"watchers_count":2315,"language":"Go","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":208,"mirror_url":null,"archived":false,"open_issues_count":73,"license":{"key":"apache-2.0","name":"Apache License 2.0","spdx_id":"Apache-2.0","url":"https://api.github.com/licenses/apache-2.0"},"forks":208,"open_issues":73,"watchers":2315,"default_branch":"master"}},"base":{"label":"kubeless:master","ref":"master","sha":"c832c4600461a689d0441a10ab12826831d2ef00","user":{"login":"kubeless","id":25339039,"avatar_url":"https://avatars3.githubusercontent.com/u/25339039?v=4","gravatar_id":"","url":"https://api.github.com/users/kubeless","html_url":"https://github.com/kubeless","followers_url":"https://api.github.com/users/kubeless/followers","following_url":"https://api.github.com/users/kubeless/following{/other_user}","gists_url":"https://api.github.com/users/kubeless/gists{/gist_id}","starred_url":"https://api.github.com/users/kubeless/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kubeless/subscriptions","organizations_url":"https://api.github.com/users/kubeless/orgs","repos_url":"https://api.github.com/users/kubeless/repos","events_url":"https://api.github.com/users/kubeless/events{/privacy}","received_events_url":"https://api.github.com/users/kubeless/received_events","type":"Organization","site_admin":false},"repo":{"id":73902337,"name":"kubeless","full_name":"kubeless/kubeless","owner":{"login":"kubeless","id":25339039,"avatar_url":"https://avatars3.githubusercontent.com/u/25339039?v=4","gravatar_id":"","url":"https://api.github.com/users/kubeless","html_url":"https://github.com/kubeless","followers_url":"https://api.github.com/users/kubeless/followers","following_url":"https://api.github.com/users/kubeless/following{/other_user}","gists_url":"https://api.github.com/users/kubeless/gists{/gist_id}","starred_url":"https://api.github.com/users/kubeless/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kubeless/subscriptions","organizations_url":"https://api.github.com/users/kubeless/orgs","repos_url":"https://api.github.com/users/kubeless/repos","events_url":"https://api.github.com/users/kubeless/events{/privacy}","received_events_url":"https://api.github.com/users/kubeless/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/kubeless/kubeless","description":"Kubernetes Native Serverless Framework","fork":false,"url":"https://api.github.com/repos/kubeless/kubeless","forks_url":"https://api.github.com/repos/kubeless/kubeless/forks","keys_url":"https://api.github.com/repos/kubeless/kubeless/keys{/key_id}","collaborators_url":"https://api.github.com/repos/kubeless/kubeless/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/kubeless/kubeless/teams","hooks_url":"https://api.github.com/repos/kubeless/kubeless/hooks","issue_events_url":"https://api.github.com/repos/kubeless/kubeless/issues/events{/number}","events_url":"https://api.github.com/repos/kubeless/kubeless/events","assignees_url":"https://api.github.com/repos/kubeless/kubeless/assignees{/user}","branches_url":"https://api.github.com/repos/kubeless/kubeless/branches{/branch}","tags_url":"https://api.github.com/repos/kubeless/kubeless/tags","blobs_url":"https://api.github.com/repos/kubeless/kubeless/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/kubeless/kubeless/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/kubeless/kubeless/git/refs{/sha}","trees_url":"https://api.github.com/repos/kubeless/kubeless/git/trees{/sha}","statuses_url":"https://api.github.com/repos/kubeless/kubeless/statuses/{sha}","languages_url":"https://api.github.com/repos/kubeless/kubeless/languages","stargazers_url":"https://api.github.com/repos/kubeless/kubeless/stargazers","contributors_url":"https://api.github.com/repos/kubeless/kubeless/contributors","subscribers_url":"https://api.github.com/repos/kubeless/kubeless/subscribers","subscription_url":"https://api.github.com/repos/kubeless/kubeless/subscription","commits_url":"https://api.github.com/repos/kubeless/kubeless/commits{/sha}","git_commits_url":"https://api.github.com/repos/kubeless/kubeless/git/commits{/sha}","comments_url":"https://api.github.com/repos/kubeless/kubeless/comments{/number}","issue_comment_url":"https://api.github.com/repos/kubeless/kubeless/issues/comments{/number}","contents_url":"https://api.github.com/repos/kubeless/kubeless/contents/{+path}","compare_url":"https://api.github.com/repos/kubeless/kubeless/compare/{base}...{head}","merges_url":"https://api.github.com/repos/kubeless/kubeless/merges","archive_url":"https://api.github.com/repos/kubeless/kubeless/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/kubeless/kubeless/downloads","issues_url":"https://api.github.com/repos/kubeless/kubeless/issues{/number}","pulls_url":"https://api.github.com/repos/kubeless/kubeless/pulls{/number}","milestones_url":"https://api.github.com/repos/kubeless/kubeless/milestones{/number}","notifications_url":"https://api.github.com/repos/kubeless/kubeless/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/kubeless/kubeless/labels{/name}","releases_url":"https://api.github.com/repos/kubeless/kubeless/releases{/id}","deployments_url":"https://api.github.com/repos/kubeless/kubeless/deployments","created_at":"2016-11-16T09:03:03Z","updated_at":"2018-04-17T00:02:04Z","pushed_at":"2018-04-16T16:08:05Z","git_url":"git://github.com/kubeless/kubeless.git","ssh_url":"git@github.com:kubeless/kubeless.git","clone_url":"https://github.com/kubeless/kubeless.git","svn_url":"https://github.com/kubeless/kubeless","homepage":"http://kubeless.io","size":63283,"stargazers_count":2315,"watchers_count":2315,"language":"Go","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":208,"mirror_url":null,"archived":false,"open_issues_count":73,"license":{"key":"apache-2.0","name":"Apache License 2.0","spdx_id":"Apache-2.0","url":"https://api.github.com/licenses/apache-2.0"},"forks":208,"open_issues":73,"watchers":2315,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/kubeless/kubeless/pulls/689"},"html":{"href":"https://github.com/kubeless/kubeless/pull/689"},"issue":{"href":"https://api.github.com/repos/kubeless/kubeless/issues/689"},"comments":{"href":"https://api.github.com/repos/kubeless/kubeless/issues/689/comments"},"review_comments":{"href":"https://api.github.com/repos/kubeless/kubeless/pulls/689/comments"},"review_comment":{"href":"https://api.github.com/repos/kubeless/kubeless/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/kubeless/kubeless/pulls/689/commits"},"statuses":{"href":"https://api.github.com/repos/kubeless/kubeless/statuses/a3b0ccda6a74c857b2ddaf48c0ea38eb09556cde"}},"author_association":"CONTRIBUTOR"}}
{"actor":{"display_login":"murali-reddy"}}