Skip to content

Commit

Permalink
correct namespace
Browse files Browse the repository at this point in the history
  • Loading branch information
alexboden committed Nov 21, 2024
1 parent ab00028 commit 441b639
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 6 deletions.
7 changes: 2 additions & 5 deletions KubernetesLogFormatter.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,6 @@
import os
import logging

POD_NAME = os.getenv('HOSTNAME', 'unknown-pod')
NAMESPACE = get_kubernetes_namespace()

def get_kubernetes_namespace():
namespace_file = "/var/run/secrets/kubernetes.io/serviceaccount/namespace"
try:
Expand All @@ -22,7 +19,7 @@ def format(self, record):
"timestamp": self.formatTime(record, self.datefmt),
"level": record.levelname,
"message": record.getMessage(),
"pod_name": POD_NAME,
"namespace": NAMESPACE,
"pod_name": os.getenv('HOSTNAME', 'unknown-pod'),
"namespace": get_kubernetes_namespace(),
}
return json.dumps(log_record)
2 changes: 1 addition & 1 deletion main.py
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,7 @@ def allocate_runners_for_jobs(workflow_data, token):

for i in range(number_of_queued_workflows):
workflow_id = workflow_data["workflow_runs"][i]["id"]
logger.info(f"Evaluating workflow ID: {workflow_id}")
# logger.info(f"Evaluating workflow ID: {workflow_id}")
branch = workflow_data["workflow_runs"][i]["head_branch"]
if branch != "alexboden/test-slurm-gha-runner" and branch != "alexboden/test-ci-apptainer":
continue
Expand Down

0 comments on commit 441b639

Please sign in to comment.