Skip to content

Commit dbf3709

Browse files
committed
Fix registry to use local registry host
Signed-off-by: Salvatore Daniele <[email protected]>
1 parent 68a715d commit dbf3709

File tree

1 file changed

+18
-17
lines changed

1 file changed

+18
-17
lines changed

extraConfigDpu.py

Lines changed: 18 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -208,30 +208,31 @@ def build_dpu_operator_images() -> str:
208208
return registry
209209

210210

211-
def start_dpu_operator(host: host.Host, client: K8sClient, operator_image: str, daemon_image: str, repo_wipe: bool = False) -> None:
212-
logger.info(f"Deploying dpu operator containers on {host.hostname()}")
211+
def start_dpu_operator(h: host.Host, client: K8sClient, operator_image: str, daemon_image: str, repo_wipe: bool = False) -> None:
212+
logger.info(f"Deploying dpu operator containers on {h.hostname()}")
213213
if repo_wipe:
214-
host.run(f"rm -rf {REPO_DIR}")
215-
host.run_or_die(f"git clone {DPU_OPERATOR_REPO}")
214+
h.run(f"rm -rf {REPO_DIR}")
215+
h.run_or_die(f"git clone {DPU_OPERATOR_REPO}")
216216
render_local_images_yaml(operator_image=operator_image, daemon_image=daemon_image, outfilename="/tmp/dpu-local-images-template.yaml", pull_policy="IfNotPresent")
217-
host.copy_to("/tmp/dpu-local-images-template.yaml", f"{REPO_DIR}/config/dev/local-images-template.yaml")
218-
219-
host.run("dnf install -y pip")
220-
host.run_or_die("pip install yq")
221-
ensure_go_installed(host)
222-
reglocal.local_trust(host)
223-
host.run_or_die(f"podman pull {operator_image}")
224-
host.run_or_die(f"podman pull {daemon_image}")
225-
if host.is_localhost():
217+
h.copy_to("/tmp/dpu-local-images-template.yaml", f"{REPO_DIR}/config/dev/local-images-template.yaml")
218+
219+
h.run("dnf install -y pip")
220+
h.run_or_die("pip install yq")
221+
ensure_go_installed(h)
222+
reglocal.local_trust(h)
223+
h.run_or_die(f"podman pull {operator_image}")
224+
h.run_or_die(f"podman pull {daemon_image}")
225+
if h.is_localhost():
226226
env = os.environ.copy()
227227
env["KUBECONFIG"] = client._kc
228-
host.run(f"make -C {REPO_DIR} undeploy", env=env)
229-
ret = host.run(f"make -C {REPO_DIR} local-deploy", env=env)
228+
env["REGISTRY"] = host.LocalHost().hostname()
229+
h.run(f"make -C {REPO_DIR} undeploy", env=env)
230+
ret = h.run(f"make -C {REPO_DIR} local-deploy", env=env)
230231
if not ret.success():
231232
logger.error_and_exit("Failed to deploy dpu operator")
232233
else:
233-
host.run(f"cd {REPO_DIR} && export KUBECONFIG={client._kc} && make undeploy")
234-
host.run_or_die(f"cd {REPO_DIR} && export KUBECONFIG={client._kc} && make local-deploy")
234+
h.run(f"cd {REPO_DIR} && export KUBECONFIG={client._kc} && make undeploy")
235+
h.run_or_die(f"cd {REPO_DIR} && export KUBECONFIG={client._kc} && make local-deploy")
235236
logger.info("Waiting for all dpu operator pods to become ready")
236237
time.sleep(30)
237238
client.oc_run_or_die("wait --for=condition=Ready pod --all -n openshift-dpu-operator --timeout=5m")

0 commit comments

Comments
 (0)