Skip to content

Commit

Permalink
Merge branch 'master' into sensitive-data
Browse files Browse the repository at this point in the history
  • Loading branch information
wasim-nihal authored Feb 28, 2024
2 parents b44a4b4 + ac2354a commit 878988c
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 5 deletions.
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM python:3.12.1-alpine3.18 as base
FROM python:3.13.0a4-alpine3.18 as base

FROM base as builder
WORKDIR /app
Expand Down
4 changes: 2 additions & 2 deletions src/requirements.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
kubernetes==28.1.0
requests==2.31.0
python-json-logger==2.0.7
logfmter==0.0.6
argparse==1.4.0
logfmter==0.0.7
argparse==1.4.0
5 changes: 3 additions & 2 deletions src/resources.py
Original file line number Diff line number Diff line change
Expand Up @@ -365,8 +365,6 @@ def _watch_resource_iterator(label, label_value, target_folder, request_url, req
def _watch_resource_loop(mode, *args):
while True:
try:
# Always wait to slow down the loop in case of exceptions
sleep(int(os.getenv("ERROR_THROTTLE_SLEEP", 5)))
if mode == "SLEEP":
list_resources(*args)
sleep(int(os.getenv("SLEEP_TIME", 60)))
Expand All @@ -379,11 +377,14 @@ def _watch_resource_loop(mode, *args):
raise
except ProtocolError as e:
logger.error(f"ProtocolError when calling kubernetes: {e}\n")
sleep(int(os.getenv("ERROR_THROTTLE_SLEEP", 5)))
except MaxRetryError as e:
logger.error(f"MaxRetryError when calling kubernetes: {e}\n")
sleep(int(os.getenv("ERROR_THROTTLE_SLEEP", 5)))
except Exception as e:
logger.error(f"Received unknown exception: {e}\n")
traceback.print_exc()
sleep(int(os.getenv("ERROR_THROTTLE_SLEEP", 5)))


def watch_for_changes(mode, label, label_value, target_folder, request_url, request_method, request_payload,
Expand Down

0 comments on commit 878988c

Please sign in to comment.