Skip to content

Commit 47cd21d

Browse files
committed
k8sclient: fix typo in ensure_oc_installed
Fix type. Also break the curl into separate commands. The current way it is written will fail when run on localhost due to the way that subprocess handles the pipe. Signed-off-by: Salvatore Daniele <[email protected]>
1 parent 743d635 commit 47cd21d

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

k8sClient.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21,9 +21,10 @@ def __init__(self, kubeconfig: str, host: host.Host = host.LocalHost()):
2121
def _ensure_oc_installed(self) -> None:
2222
if self._host.run("which oc").returncode == 0:
2323
return
24-
uname = self._host.run_or_die("uname -m").out
25-
url = f"https://mirror.openshift.com/pub/openshift-v4/${uname}/clients/ocp/stable/openshift-client-linux.tar.gz"
26-
self._host.run_or_die(f"curl {url} | sudo tar -U -C /usr/local/bin -xzf -")
24+
uname = self._host.run_or_die("uname -m").out.strip()
25+
url = f"https://mirror.openshift.com/pub/openshift-v4/{uname}/clients/ocp/stable/openshift-client-linux.tar.gz"
26+
self._host.run_or_die(f"curl -L {url} -o /tmp/openshift-client-linux.tar.gz")
27+
self._host.run_or_die("sudo tar -U -C /usr/local/bin -xzf /tmp/openshift-client-linux.tar.gz")
2728

2829
def is_ready(self, name: str) -> bool:
2930
for e in self._client.list_node().items:

0 commit comments

Comments
 (0)