Use image-overrides to load locally build images into kind cluster

pull/751/head
pranav 2026-05-04 16:54:52 +05:30
parent 7c65d39bb2
commit e933f112c6
1 changed files with 5 additions and 10 deletions

View File

@ -833,16 +833,11 @@ class K8sDeployer(Deployer):
actual_cluster = create_cluster(self.kind_cluster_name, kind_config) actual_cluster = create_cluster(self.kind_cluster_name, kind_config)
if actual_cluster != self.kind_cluster_name: if actual_cluster != self.kind_cluster_name:
self.kind_cluster_name = actual_cluster self.kind_cluster_name = actual_cluster
# Only load locally-built images into kind # Pre-load images into kind so pods can use them with
local_containers = self.deployment_context.stack.obj.get("containers", []) # imagePullPolicy: IfNotPresent before the registry is consulted.
if local_containers: images_to_preload = set((self.image_overrides or {}).values())
local_images = { if images_to_preload:
img load_images_into_kind(self.kind_cluster_name, images_to_preload)
for img in self.cluster_info.image_set
if any(c in img for c in local_containers)
}
if local_images:
load_images_into_kind(self.kind_cluster_name, local_images)
elif self.is_kind(): elif self.is_kind():
# --skip-cluster-management (default): cluster must already exist. # --skip-cluster-management (default): cluster must already exist.
# Without this check, connect_api() below raises a cryptic # Without this check, connect_api() below raises a cryptic