Use image-overrides to load locally build images into kind cluster
parent
7c65d39bb2
commit
e933f112c6
|
|
@ -833,16 +833,11 @@ class K8sDeployer(Deployer):
|
|||
actual_cluster = create_cluster(self.kind_cluster_name, kind_config)
|
||||
if actual_cluster != self.kind_cluster_name:
|
||||
self.kind_cluster_name = actual_cluster
|
||||
# Only load locally-built images into kind
|
||||
local_containers = self.deployment_context.stack.obj.get("containers", [])
|
||||
if local_containers:
|
||||
local_images = {
|
||||
img
|
||||
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)
|
||||
# Pre-load images into kind so pods can use them with
|
||||
# imagePullPolicy: IfNotPresent before the registry is consulted.
|
||||
images_to_preload = set((self.image_overrides or {}).values())
|
||||
if images_to_preload:
|
||||
load_images_into_kind(self.kind_cluster_name, images_to_preload)
|
||||
elif self.is_kind():
|
||||
# --skip-cluster-management (default): cluster must already exist.
|
||||
# Without this check, connect_api() below raises a cryptic
|
||||
|
|
|
|||
Loading…
Reference in New Issue