in cli/src/klio_cli/commands/job/gke.py [0:0]
def _apply_image_to_deployment_config(self, deployment_config):
image_tag = self.docker_runtime_config.image_tag
pipeline_options = self.klio_config.pipeline_options
if image_tag:
image_path = "spec.template.spec.containers.0.image"
# TODO: If more than one image deployed,
# we need to search for correct container
image_base = glom.glom(deployment_config, image_path)
# Strip off existing image tag if any
image_base = re.split(":", image_base)[0]
full_image = f"{image_base}:{image_tag}"
glom.assign(deployment_config, image_path, full_image)
# Check to see if the kubernetes image to be deployed is the same
# image that is built
k8s_image = glom.glom(deployment_config, image_path)
built_image_base = pipeline_options.worker_harness_container_image
built_image = f"{built_image_base}:{image_tag}"
if built_image != k8s_image:
logging.warning(
f"Image deployed by kubernetes {k8s_image} does not match "
f"the built image {built_image}. "
"This may result in an `ImagePullBackoff` for the deployment. "
"If this is not intended, please change "
"`pipeline_options.worker_harness_container_image` "
"and rebuild or change the container image"
"set in kubernetes/deployment.yaml file."
)