Commit Graph

16 Commits

Author SHA1 Message Date
Tim Hockin
0f97a73c1b Rename a bunch of "Make" functions to "New"
Also rename some to other names that make better reading.  There are still a
bunch of "make" functions but they do things like assemble a string from parts
or build an array of things.  It seemed that "make" there seemed fine.  "New"
is for "constructors".
2014-08-20 21:27:19 -07:00
Brendan Burns
05ab1e49fb Address some follow up comments. 2014-08-18 12:49:52 -07:00
Brendan Burns
0caae9c1d4 Add a in container exec based health check. 2014-08-18 12:00:11 -07:00
Tim Hockin
bca90f4866 Reduce and comment exports 2014-08-11 00:11:59 -07:00
Tim Hockin
7beac7a9af Split health_check.go into smaller parts.
Distinct files for core, http, and tcp.
2014-08-11 00:01:17 -07:00
Tim Hockin
24c516ec1d Move HTTP code out of health.go
Put it with the related HTTP code.
2014-08-10 23:50:06 -07:00
Tim Hockin
c67c1edfb4 Use IntOrString for TCP health check ports
Clean up code to be more testable.  Add test cases for named and numeric
ports in TCP health checks.  Improve tests.
2014-08-10 23:44:42 -07:00
Tim Hockin
7201227cb1 Use IntOrString for HTTP health check ports
Clean up code to be more testable.  Add test cases for named and numeric
ports in HTTP health checks.  Improve tests.
2014-08-10 23:26:42 -07:00
Brendan Burns
490bb28bf9 Add TCP socket based health checking. 2014-08-01 14:13:56 -07:00
Kelsey Hightower
c860ac3afc health: Improve test coverage 2014-07-27 08:44:59 -07:00
Kelsey Hightower
fce90dc761 Improve test coverage for the health package and remove mocks
The current tests for the health package utilize a fake HTTP client
for testing health checks and only cover a limited set of test cases.

This patch removes the need for mocks by using the httptest package
from the standard library. After removing the fake HTTP client a bug
was found in the health.Check function; it incorrectly assumes that
a http.Response is always non-nil. Fix the issue by moving the defer
that closes the http.Response.Body after error handling.

Related tests in the registry package have be refactored to work with
the changes made to the health.Check function. All methods that implement
the health.HTTPGetInterface interface now return a http.Response with
with a noop http.Response.Body.

This patch does not introduce any changes in behavior.
2014-07-21 15:30:29 -07:00
Yuki Yugui Sonoda
e0d749f952 fix typo 2014-07-18 14:13:55 +09:00
Yuki Yugui Sonoda
5e31ca3b27 Correct godoc messages according to review comments 2014-07-17 12:27:58 +09:00
Yuki Sonoda (Yugui)
df9da65939 Rename a function according to go convention 2014-07-16 22:05:06 +09:00
Yuki Sonoda (Yugui)
f368e4be68 Fixes golint errors in pkg/health 2014-07-16 21:59:21 +09:00
Brendan Burns
c5db874090 Addressed comments. 2014-07-15 15:16:36 -07:00