mirror of
https://github.com/cloudnativelabs/kube-router.git
synced 2025-11-29 08:51:29 +01:00
adding output messages
This commit is contained in:
parent
3469cc182c
commit
3eb5461fe4
@ -22,6 +22,7 @@ type HealthController struct {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func sendHeartBeat(channel chan<- *ControllerHeartbeat, controller string) {
|
func sendHeartBeat(channel chan<- *ControllerHeartbeat, controller string) {
|
||||||
|
glog.Infof("Send Heartbeat from %s", controller)
|
||||||
heartbeat := ControllerHeartbeat{
|
heartbeat := ControllerHeartbeat{
|
||||||
Component: controller,
|
Component: controller,
|
||||||
Lastheartbeat: time.Now(),
|
Lastheartbeat: time.Now(),
|
||||||
@ -31,7 +32,7 @@ func sendHeartBeat(channel chan<- *ControllerHeartbeat, controller string) {
|
|||||||
|
|
||||||
func (hc *HealthController) Handler(w http.ResponseWriter, req *http.Request) {
|
func (hc *HealthController) Handler(w http.ResponseWriter, req *http.Request) {
|
||||||
w.WriteHeader(http.StatusOK)
|
w.WriteHeader(http.StatusOK)
|
||||||
w.Write([]byte("These aren't the droids you're looking for"))
|
w.Write([]byte("These aren't the droids you're looking for\n"))
|
||||||
}
|
}
|
||||||
|
|
||||||
func (hc *HealthController) Run(healthChan <-chan *ControllerHeartbeat, stopCh <-chan struct{}, wg *sync.WaitGroup) error {
|
func (hc *HealthController) Run(healthChan <-chan *ControllerHeartbeat, stopCh <-chan struct{}, wg *sync.WaitGroup) error {
|
||||||
@ -60,8 +61,9 @@ func (hc *HealthController) Run(healthChan <-chan *ControllerHeartbeat, stopCh <
|
|||||||
}
|
}
|
||||||
return nil
|
return nil
|
||||||
case heartbeat := <-healthChan:
|
case heartbeat := <-healthChan:
|
||||||
glog.V(3).Infof("Received heartbeat from %s", heartbeat.Component)
|
glog.Infof("Received heartbeat from %s", heartbeat.Component)
|
||||||
case <-t.C:
|
case <-t.C:
|
||||||
|
glog.Infof("Health controller tick")
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user