ripe-winter-58734
01/15/2025, 4:17 PMtry:
run_job_infra_image = gcp.artifactregistry.get_docker_image_output(
location=repository.location,
repository_id=repository.repository_id,
image_name=f"run-job-infra-{env_long}")
except Exception as e:
run_job_infra_image = None
if run_job_infra_image:
... build some more stuff
However when I "pulumi up", script raises exception and stops...
Any hints on why I cannot catch the exception ?
Error log:
Exception: invoke of gcpartifactregistry/getDockerImagegetDockerImage failed: invocation of gcpartifactregistry/getDockerImagegetDockerImage returned an error: invoking gcpartifactregistry/getDockerImagegetDockerImage: 1 error occurred:
* Requested image was not found.modern-zebra-45309
01/16/2025, 8:30 AMgcp.artifactregistry.get_docker_image_output
is executed when the program is executed, but the actual get operation runs when the Pulumi deployment engine is bringing your infrastructure into the desired state. Like all Pulumi Outputs, it's only resolved at runtime.modern-zebra-45309
01/16/2025, 8:32 AMprint
statements in your code, like this:
print("Attempting to find Docker image")
try:
run_job_infra_image = gcp.artifactregistry.get_docker_image_output(
location=repository.location,
repository_id=repository.repository_id,
image_name=f"run-job-infra-{env_long}")
print("Executed get_docker_image_output()")
except Exception as e:
run_job_infra_image = None
print("Done with the try/except block")
if run_job_infra_image:
... build some more stuff
modern-zebra-45309
01/16/2025, 8:33 AMmodern-zebra-45309
01/16/2025, 8:35 AMgcp.artifactregistry.get_docker_image
should give you an awaitable result.ripe-winter-58734
01/16/2025, 2:22 PMmodern-zebra-45309
01/16/2025, 2:35 PMripe-winter-58734
01/16/2025, 2:35 PM