Skip to content

Commit

Permalink
Don't process pods that have no package name label
Browse files Browse the repository at this point in the history
  • Loading branch information
jjnesbitt committed Dec 8, 2023
1 parent 7ba060a commit d2f4caa
Showing 1 changed file with 6 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -140,6 +140,12 @@ def handle_scheduled_pipeline_pod(wrapped_event: dict, start_time: datetime):
logger.warning(f'Could not retrieve pod {pod_name} in namespace "pipeline"')
return

# Ensure that this pod has a non-empty package name label before continuing
labels: dict = pod.to_dict()["metadata"]["labels"]
if labels.get("metrics/spack_job_spec_pkg_name", "") == "":
logger.debug(f"Skipping pod with missing package name: {pod_name}")
return

# Retrieve node
node_name = pod.to_dict()["spec"]["node_name"]
node = client.read_node(name=node_name).to_dict() # type: ignore
Expand Down

0 comments on commit d2f4caa

Please sign in to comment.