mirror of
https://github.com/coredns/coredns.git
synced 2025-11-01 02:33:14 -04:00
healhcheck: various cleanups (#1106)
* healhcheck: various cleanups Network wasn't used. IgnorePaths wasn't used. Move checkdown function to common function shared between proxy protocols. And some naming fixed. Also reset the Fails on a succesful healthcheck back to 0. remove newlines from log * compile * fix test
This commit is contained in:
@@ -23,10 +23,8 @@ type apiProxy struct {
|
||||
func (p *proxyHandler) ServeHTTP(w http.ResponseWriter, r *http.Request) {
|
||||
upstream := p.Select()
|
||||
network := "tcp"
|
||||
if upstream.Network != "" {
|
||||
network = upstream.Network
|
||||
}
|
||||
address := upstream.Name
|
||||
|
||||
d, err := net.Dial(network, address)
|
||||
if err != nil {
|
||||
log.Printf("[ERROR] Unable to establish connection to upstream %s://%s: %s", network, address, err)
|
||||
|
||||
@@ -190,9 +190,9 @@ func (k *Kubernetes) getClientConfig() (*rest.Config, error) {
|
||||
|
||||
down := false
|
||||
|
||||
uh.CheckMu.Lock()
|
||||
uh.Lock()
|
||||
until := uh.OkUntil
|
||||
uh.CheckMu.Unlock()
|
||||
uh.Unlock()
|
||||
|
||||
if !until.IsZero() && time.Now().After(until) {
|
||||
down = true
|
||||
|
||||
Reference in New Issue
Block a user