Count cni DEL failure as well to mark it unhealthy
We only count cni add failure to mark cni healthy. We should
also count del failures. We ignore the case when the annotations
is absent and del fails.
@@ -112,6 +112,7 @@ class DaemonServer(object):
"registry: %s. Ignoring.", e)
return '', httplib.NO_CONTENT, self.headers
except Exception:
+ self._check_failure()
LOG.exception('Error when processing delNetwork request. CNI '
'Params: %s.', params)
return '', httplib.INTERNAL_SERVER_ERROR, self.headers
@@ -140,7 +141,8 @@ class DaemonServer(object):
self.failure_count.value += 1
else:
with self.healthy.get_lock():
- LOG.debug("Reporting maximun CNI ADD failures reached.")
+ LOG.debug("Reporting maximum CNI ADD/DEL failures "
+ "reached.")
self.healthy.value = False
