Commit dc5384a1 authored by Penghao Cen's avatar Penghao Cen

Don't rewrite device health

parent a19f6d14
...@@ -115,16 +115,8 @@ func (m *Stub) Register(kubeletEndpoint, resourceName string) error { ...@@ -115,16 +115,8 @@ func (m *Stub) Register(kubeletEndpoint, resourceName string) error {
// ListAndWatch lists devices and update that list according to the Update call // ListAndWatch lists devices and update that list according to the Update call
func (m *Stub) ListAndWatch(e *pluginapi.Empty, s pluginapi.DevicePlugin_ListAndWatchServer) error { func (m *Stub) ListAndWatch(e *pluginapi.Empty, s pluginapi.DevicePlugin_ListAndWatchServer) error {
log.Println("ListAndWatch") log.Println("ListAndWatch")
var devs []*pluginapi.Device
for _, d := range m.devs { s.Send(&pluginapi.ListAndWatchResponse{Devices: m.devs})
devs = append(devs, &pluginapi.Device{
ID: d.ID,
Health: pluginapi.Healthy,
})
}
s.Send(&pluginapi.ListAndWatchResponse{Devices: devs})
for { for {
select { select {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment