23 Commits

Author SHA1 Message Date
Paul Banks
e812f5516a Add -sidecar-for and new /agent/service/:service_id endpoint (#4691)
- A new endpoint `/v1/agent/service/:service_id` which is a generic way to look up the service for a single instance. The primary value here is that it:
   - **supports hash-based blocking** and so;
   - **replaces `/agent/connect/proxy/:proxy_id`** as the mechanism the built-in proxy uses to read its config.
   - It's not proxy specific and so works for any service.
   - It has a temporary shim to call through to the existing endpoint to preserve current managed proxy config defaulting behaviour until that is removed entirely (tested).
 - The built-in proxy now uses the new endpoint exclusively for it's config
 - The built-in proxy now has a `-sidecar-for` flag that allows the service ID of the _target_ service to be specified, on the condition that there is exactly one "sidecar" proxy (that is one that has `Proxy.DestinationServiceID` set) for the service registered.
 - Several fixes for edge cases for SidecarService
 - A fix for `Alias` checks - when running locally they didn't update their state until some external thing updated the target. If the target service has no checks registered as below, then the alias never made it past critical.
2018-10-10 16:55:34 +01:00
Mitchell Hashimoto
8c713e6104
connect/proxy: don't require proxy ID 2018-06-14 09:42:20 -07:00
Paul Banks
e0e12e165b
TLS watching integrated into Service with some basic tests.
There are also a lot of small bug fixes found when testing lots of things end-to-end for the first time and some cleanup now it's integrated with real CA code.
2018-06-14 09:42:07 -07:00
Paul Banks
e8c510332c
Support legacy watch.HandlerFunc type for backward compat reduces impact of change 2018-06-14 09:42:05 -07:00
Paul Banks
ab3df3d4a6
Working proxy config reload tests 2018-06-14 09:42:05 -07:00
Paul Banks
cd88b2a351
Basic watch support for connect proxy config and certificate endpoints.
- Includes some bug fixes for previous `api` work and `agent` that weren't tested
 - Needed somewhat pervasive changes to support hash based blocking - some TODOs left in our watch toolchain that will explicitly fail on hash-based watches.
 - Integration into `connect` is partially done here but still WIP
2018-06-14 09:42:05 -07:00
James Phillips
8d0a048408 Expands and rework context support in the API client. (#3273) 2017-07-14 17:30:08 -07:00
Preetha Appan
d25be8671a Make sure to call cancel on the context 2017-06-27 16:22:57 -05:00
Preetha Appan
a6c3cf0403 Made helper method for query options with context 2017-06-26 16:11:14 -05:00
Preetha Appan
9eaf56bfe3 Fix socket file handle leaks from old blocking queries upon consul reload. This fixes issue #3018 2017-06-26 15:52:03 -05:00
Frank Schroeder
d7e23857ad golint: No stutter 2017-04-25 09:26:13 -07:00
James Phillips
888f27de2b
Moves stale code to same spot and adds it everywhere that supports it. 2016-08-10 15:49:51 -07:00
Evan Gilman
965fcf9d6b
Enable Stale mode for watchers
Solves https://github.com/hashicorp/consul/issues/917 by giving consul
watch a `-stale` flag
2016-05-10 00:09:15 -07:00
Ryan Uber
5555e0eb9b api: initial import from armon/consul-api 2015-01-06 10:40:00 -08:00
Armon Dadgar
e13ba2f2da watch: Adding support for events 2014-08-28 15:41:06 -07:00
Armon Dadgar
ad40ddf361 watch: Remove DSL in place of JSON 2014-08-21 11:38:44 -07:00
Armon Dadgar
5aefdf01a0 watch: support checks watch 2014-08-20 16:32:12 -07:00
Armon Dadgar
f3c8873009 watch: supporting service watch 2014-08-20 15:50:32 -07:00
Armon Dadgar
8d70128761 watch: node watcher 2014-08-20 15:33:13 -07:00
Armon Dadgar
00358baa7f watch: service watcher 2014-08-20 15:29:31 -07:00
Armon Dadgar
970c606f1a watch: Support for key prefix 2014-08-20 15:22:22 -07:00
Armon Dadgar
68a829119e watch: test key watch 2014-08-20 15:18:08 -07:00
Armon Dadgar
66edf0075a watch: Testing plan execution 2014-08-20 13:45:34 -07:00