In k8s reflector, DeltaFiFo.Replace function

1/19/2017

In reflector framework, it will first exec 'LIST' request and then watch changes. Get the list result and put them into a queue(such as DeltaFiFo) by calling Replace function, however, when compute key error it will just return and listwatch will end to exec next round ListAndWatch.

Source code of delta_fifo.go#L435 (source on Github)

One drop of poison infects the whole tun of wine.

I don't know why deal with it in this way. When one of the items is in wrong state(so it will result in computing key error all the time), ListAndWatch will always fail. I think log the error instead of return is a better way.

Thanks.

-- Bling
kubernetes

0 Answers