In DevicePluginHandlerImpl.Allocate(), skips untracked extended resources.

Otherwise, we would fail a Pod allocation request that has an extended
resource not managed by any device plugin.
pull/6/head
Jiaying Zhang 2017-10-06 13:40:04 -07:00
parent 6ac018af01
commit ee1ffa619b
1 changed files with 2 additions and 1 deletions

View File

@ -166,7 +166,8 @@ func (h *DevicePluginHandlerImpl) Allocate(pod *v1.Pod, container *v1.Container,
resource := string(k)
needed := int(v.Value())
glog.V(3).Infof("needs %d %s", needed, resource)
if !deviceplugin.IsDeviceName(k) || needed == 0 {
_, registeredResource := h.allDevices[resource]
if !registeredResource || needed == 0 {
continue
}
h.Lock()