{"action":"created","issue":{"url":"https://api.github.com/repos/runconduit/conduit/issues/568","repository_url":"https://api.github.com/repos/runconduit/conduit","labels_url":"https://api.github.com/repos/runconduit/conduit/issues/568/labels{/name}","comments_url":"https://api.github.com/repos/runconduit/conduit/issues/568/comments","events_url":"https://api.github.com/repos/runconduit/conduit/issues/568/events","html_url":"https://github.com/runconduit/conduit/pull/568","id":304980926,"number":568,"title":"Update destination service to send NoEndpoints updates","user":{"login":"klingerf","id":9226,"avatar_url":"https://avatars0.githubusercontent.com/u/9226?v=4","gravatar_id":"","url":"https://api.github.com/users/klingerf","html_url":"https://github.com/klingerf","followers_url":"https://api.github.com/users/klingerf/followers","following_url":"https://api.github.com/users/klingerf/following{/other_user}","gists_url":"https://api.github.com/users/klingerf/gists{/gist_id}","starred_url":"https://api.github.com/users/klingerf/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/klingerf/subscriptions","organizations_url":"https://api.github.com/users/klingerf/orgs","repos_url":"https://api.github.com/users/klingerf/repos","events_url":"https://api.github.com/users/klingerf/events{/privacy}","received_events_url":"https://api.github.com/users/klingerf/received_events","type":"User","site_admin":false},"labels":[{"id":866158135,"url":"https://api.github.com/repos/runconduit/conduit/labels/review","name":"review","color":"f4bffc","default":false}],"state":"open","locked":false,"assignee":{"login":"klingerf","id":9226,"avatar_url":"https://avatars0.githubusercontent.com/u/9226?v=4","gravatar_id":"","url":"https://api.github.com/users/klingerf","html_url":"https://github.com/klingerf","followers_url":"https://api.github.com/users/klingerf/followers","following_url":"https://api.github.com/users/klingerf/following{/other_user}","gists_url":"https://api.github.com/users/klingerf/gists{/gist_id}","starred_url":"https://api.github.com/users/klingerf/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/klingerf/subscriptions","organizations_url":"https://api.github.com/users/klingerf/orgs","repos_url":"https://api.github.com/users/klingerf/repos","events_url":"https://api.github.com/users/klingerf/events{/privacy}","received_events_url":"https://api.github.com/users/klingerf/received_events","type":"User","site_admin":false},"assignees":[{"login":"klingerf","id":9226,"avatar_url":"https://avatars0.githubusercontent.com/u/9226?v=4","gravatar_id":"","url":"https://api.github.com/users/klingerf","html_url":"https://github.com/klingerf","followers_url":"https://api.github.com/users/klingerf/followers","following_url":"https://api.github.com/users/klingerf/following{/other_user}","gists_url":"https://api.github.com/users/klingerf/gists{/gist_id}","starred_url":"https://api.github.com/users/klingerf/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/klingerf/subscriptions","organizations_url":"https://api.github.com/users/klingerf/orgs","repos_url":"https://api.github.com/users/klingerf/repos","events_url":"https://api.github.com/users/klingerf/events{/privacy}","received_events_url":"https://api.github.com/users/klingerf/received_events","type":"User","site_admin":false}],"milestone":null,"comments":2,"created_at":"2018-03-14T00:20:03Z","updated_at":"2018-03-19T16:46:16Z","closed_at":null,"author_association":"OWNER","pull_request":{"url":"https://api.github.com/repos/runconduit/conduit/pulls/568","html_url":"https://github.com/runconduit/conduit/pull/568","diff_url":"https://github.com/runconduit/conduit/pull/568.diff","patch_url":"https://github.com/runconduit/conduit/pull/568.patch"},"body":"In this branch I'm updating the destination service to start sending NoEndpoints events when a client subscribes, and when a service no longer exists.\r\n\r\nThe destination service code isn't heavily tested, but I manually verified this change using the [destination-client script](https://github.com/runconduit/conduit/blob/kl/no-endpoints/controller/script/destination-client/main.go).\r\n\r\nIf I subscribe before a service exists, and then create the service, I see the following events:\r\n\r\n```\r\n$ ./bin/go-run controller/script/destination-client -path books.default.svc.cluster.local:7002\r\nINFO[0000] NoEndpoints:                                 \r\nINFO[0000] - exists:false                               \r\nINFO[0000]                                              \r\nINFO[0023] Add:                                         \r\nINFO[0023] - 172.17.0.13:7002                           \r\nINFO[0023]                                              \r\nINFO[0025] Add:                                         \r\nINFO[0025] - 172.17.0.12:7002                           \r\nINFO[0025]                                              \r\nINFO[0025] Add:                                         \r\nINFO[0025] - 172.17.0.10:7002                           \r\n```\r\n\r\nWhen I then delete the service, I see:\r\n\r\n```\r\nINFO[0044] Remove:                                      \r\nINFO[0044] - 172.17.0.10:7002                           \r\nINFO[0044]                                              \r\nINFO[0044] Remove:                                      \r\nINFO[0044] - 172.17.0.12:7002                           \r\nINFO[0044] - 172.17.0.13:7002                           \r\nINFO[0044]                                              \r\nINFO[0046] NoEndpoints:                                 \r\nINFO[0046] - exists:false                               \r\n```\r\n\r\n---\r\n\r\nWhereas if I subscribe after the service has already been created, then I see the following events:\r\n\r\n```\r\n$ ./bin/go-run controller/script/destination-client -path books.default.svc.cluster.local:7002\r\nINFO[0000] NoEndpoints:                                 \r\nINFO[0000] - exists:true                                \r\nINFO[0000]                                              \r\nINFO[0000] Add:                                         \r\nINFO[0000] - 172.17.0.10:7002                           \r\nINFO[0000] - 172.17.0.12:7002                           \r\nINFO[0000] - 172.17.0.13:7002                           \r\n```\r\n\r\nWhen I then delete the service, I see:\r\n\r\n```\r\nINFO[0009] Remove:                                      \r\nINFO[0009] - 172.17.0.13:7002                           \r\nINFO[0009]                                              \r\nINFO[0009] Remove:                                      \r\nINFO[0009] - 172.17.0.10:7002                           \r\nINFO[0009] - 172.17.0.12:7002                           \r\nINFO[0009]                                              \r\nINFO[0010] NoEndpoints:                                 \r\nINFO[0010] - exists:false                               \r\n```\r\n\r\nFixes #563."},"comment":{"url":"https://api.github.com/repos/runconduit/conduit/issues/comments/374281782","html_url":"https://github.com/runconduit/conduit/pull/568#issuecomment-374281782","issue_url":"https://api.github.com/repos/runconduit/conduit/issues/568","id":374281782,"user":{"login":"adleong","id":3979810,"avatar_url":"https://avatars0.githubusercontent.com/u/3979810?v=4","gravatar_id":"","url":"https://api.github.com/users/adleong","html_url":"https://github.com/adleong","followers_url":"https://api.github.com/users/adleong/followers","following_url":"https://api.github.com/users/adleong/following{/other_user}","gists_url":"https://api.github.com/users/adleong/gists{/gist_id}","starred_url":"https://api.github.com/users/adleong/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/adleong/subscriptions","organizations_url":"https://api.github.com/users/adleong/orgs","repos_url":"https://api.github.com/users/adleong/repos","events_url":"https://api.github.com/users/adleong/events{/privacy}","received_events_url":"https://api.github.com/users/adleong/received_events","type":"User","site_admin":false},"created_at":"2018-03-19T16:46:16Z","updated_at":"2018-03-19T16:46:16Z","author_association":"CONTRIBUTOR","body":"Thanks!  According to that description, `NoEndpoints(true); add` is equivalent to `add` so I'm not sure I understand why we send the `NoEndpoints(true)` at all."}}
{"actor":{"display_login":"adleong"}}