Add 410 return code handling
continuous-integration/drone Build is passing Details

This commit is contained in:
Lauri Võsandi 2022-10-21 12:17:38 +03:00
parent 9c8e73b04f
commit f0f72b3b89
1 changed files with 7 additions and 0 deletions

View File

@ -9,6 +9,7 @@ import string
import yaml
from prometheus_client import Counter, Gauge
from kubernetes_asyncio.client.api_client import ApiClient
from kubernetes_asyncio.client.exceptions import ApiException
from kubernetes_asyncio import client, config, watch
from time import time
import argparse
@ -221,6 +222,12 @@ async def main():
try:
gauge_watch_stream_begin_timestamp.set(time())
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:
pass