Skip to content

Commit

Permalink
logging
Browse files Browse the repository at this point in the history
  • Loading branch information
ric-evans committed Feb 10, 2025
1 parent 331b1d9 commit dcbeedd
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 5 deletions.
3 changes: 1 addition & 2 deletions skydriver/k8s/scan_backlog.py
Original file line number Diff line number Diff line change
Expand Up @@ -166,8 +166,7 @@ async def _run(
# 1st: start k8s job -- this could be any k8s job (pre- or post-ewms switchover)
# ^^^ b/c this uses local resources, if something goes wrong, this limits exposure
try:
resp = KubeAPITools.start_job(k8s_batch_api, skyscan_k8s_job)
LOGGER.info(resp)
KubeAPITools.start_job(k8s_batch_api, skyscan_k8s_job)
except kubernetes.utils.FailToCreateError as e:
# k8s job (backlog entry) will be revived & restarted in future iteration
LOGGER.exception(e)
Expand Down
6 changes: 3 additions & 3 deletions skydriver/k8s/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,18 +26,18 @@ def start_job(
if not job_dict:
raise ValueError("Job object not created")
try:
api_response = kubernetes.utils.create_from_dict(
resp = kubernetes.utils.create_from_dict(
k8s_batch_api.api_client,
job_dict,
namespace=ENV.K8S_NAMESPACE,
)
LOGGER.info(api_response)
LOGGER.info(json.dumps(resp, indent=0)) # otherwise huge
except Exception: # broad b/c re-raising
LOGGER.error("request to make k8s job failed using:")
LOGGER.error(json.dumps(job_dict, indent=4))
raise
else:
return api_response
return resp

@staticmethod
def get_pods(
Expand Down

0 comments on commit dcbeedd

Please sign in to comment.