Don't rewrite device health

This commit is contained in:
Penghao Cen 2017-11-17 13:10:25 +08:00
parent a19f6d147c
commit dc5384a139

View File

@ -115,16 +115,8 @@ func (m *Stub) Register(kubeletEndpoint, resourceName string) error {
// ListAndWatch lists devices and update that list according to the Update call
func (m *Stub) ListAndWatch(e *pluginapi.Empty, s pluginapi.DevicePlugin_ListAndWatchServer) error {
log.Println("ListAndWatch")
var devs []*pluginapi.Device
for _, d := range m.devs {
devs = append(devs, &pluginapi.Device{
ID: d.ID,
Health: pluginapi.Healthy,
})
}
s.Send(&pluginapi.ListAndWatchResponse{Devices: devs})
s.Send(&pluginapi.ListAndWatchResponse{Devices: m.devs})
for {
select {