Add pod delete control

- Push shortcut reports when pods are created/deleted
- Buffer upto 2 reports instead of dropping them
This commit is contained in:
Tom Wilkie
2016-04-21 17:34:08 +01:00
parent 64450a4830
commit cb52acbc46
12 changed files with 232 additions and 39 deletions

View File

@@ -75,7 +75,7 @@ func NewAppClient(pc ProbeConfig, hostname, target string, control xfer.ControlH
TLSClientConfig: httpTransport.TLSClientConfig,
},
conns: map[string]xfer.Websocket{},
readers: make(chan io.Reader),
readers: make(chan io.Reader, 2),
control: control,
}, nil
}
@@ -273,6 +273,7 @@ func (c *appClient) Publish(r io.Reader) error {
select {
case c.readers <- r:
default:
log.Errorf("Dropping report to %s", c.target)
}
return nil
}