Skip to content

Commit

Permalink
Check that rendered_command and docker_image are not None before crea…
Browse files Browse the repository at this point in the history
…ting task
  • Loading branch information
KaspariK committed Oct 18, 2024
1 parent 3b48d61 commit ecc12cf
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions tron/core/actionrun.py
Original file line number Diff line number Diff line change
Expand Up @@ -1292,6 +1292,16 @@ def recover(self) -> Optional[KubernetesTask]:

last_attempt = self.attempts[-1]

if last_attempt.rendered_command is None:
log.error(f"{self} rendered_command is None, cannot recover")
self.fail(exitcode.EXIT_INVALID_COMMAND)
return None

if last_attempt.command_config.docker_image is None:
log.error(f"{self} docker_image is None, cannot recover")
self.fail(exitcode.EXIT_KUBERNETES_TASK_INVALID)
return None

log.info(f"{self} recovering Kubernetes run")

task = k8s_cluster.create_task(
Expand Down

0 comments on commit ecc12cf

Please sign in to comment.