Add 410 return code handling
All checks were successful
continuous-integration/drone Build is passing

This commit is contained in:
Lauri Võsandi 2022-10-21 12:17:38 +03:00
parent 9c8e73b04f
commit f0f72b3b89

View File

@ -9,6 +9,7 @@ import string
import yaml import yaml
from prometheus_client import Counter, Gauge from prometheus_client import Counter, Gauge
from kubernetes_asyncio.client.api_client import ApiClient from kubernetes_asyncio.client.api_client import ApiClient
from kubernetes_asyncio.client.exceptions import ApiException
from kubernetes_asyncio import client, config, watch from kubernetes_asyncio import client, config, watch
from time import time from time import time
import argparse import argparse
@ -221,6 +222,12 @@ async def main():
try: try:
gauge_watch_stream_begin_timestamp.set(time()) gauge_watch_stream_begin_timestamp.set(time())
await update_loop(v1, apps_api, api_instance, revision) await update_loop(v1, apps_api, api_instance, revision)
except ApiException as e:
logger.debug("Caught exception: %s", e)
if e.status == 410:
pass
else:
raise
except asyncio.exceptions.TimeoutError: except asyncio.exceptions.TimeoutError:
pass pass