Skip to content

Commit 0d47c7a

Browse files
committed
fix: make run_console_local.sh working on WSLv1
Signed-off-by: wilmardo <[email protected]>
1 parent 812d184 commit 0d47c7a

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

scripts/run_console_local.sh

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ verify_podman_binary() {
1717
# Add port as 9000:9000 as arg when the SO is MacOS or Win
1818
add_host_port_arg (){
1919
args="--net=host"
20-
if [[ "$OSTYPE" == "darwin"* ]] || [[ "$(< /proc/version)" == *"@(Microsoft|WSL)"* ]]; then
20+
if [[ "$OSTYPE" == "darwin"* ]] || uname -r | grep -q 'Microsoft'; then
2121
args="-p 9000:9000"
2222
fi
2323
}
@@ -34,10 +34,10 @@ run_ocp_console_image (){
3434
$POD_MANAGER run -dit --rm $args \
3535
-e BRIDGE_USER_AUTH="disabled" \
3636
-e BRIDGE_K8S_MODE="off-cluster" \
37-
-e BRIDGE_K8S_MODE_OFF_CLUSTER_ENDPOINT=$endpoint \
37+
-e BRIDGE_K8S_MODE_OFF_CLUSTER_ENDPOINT="$endpoint" \
3838
-e BRIDGE_K8S_MODE_OFF_CLUSTER_SKIP_VERIFY_TLS=true \
3939
-e BRIDGE_K8S_AUTH="bearer-token" \
40-
-e BRIDGE_K8S_AUTH_BEARER_TOKEN=$(kubectl get secret "$secretname" --namespace=kube-system -o template --template='{{.data.token}}' | base64 --decode) \
40+
-e BRIDGE_K8S_AUTH_BEARER_TOKEN="$(kubectl get secret "$secretname" --namespace=kube-system -o template --template='{{.data.token}}' | base64 --decode)" \
4141
quay.io/openshift/origin-console:latest &> /dev/null
4242
}
4343

@@ -48,7 +48,7 @@ verify_ocp_console_image (){
4848
echo -e "${GREEN}The OLM is accessible via web console at:${RESET}"
4949
echo -e "${GREEN}http://localhost:9000/${RESET}"
5050
echo -e "${GREEN}Press Ctrl-C to quit${RESET}";
51-
$POD_MANAGER attach $container_id
51+
$POD_MANAGER attach "$container_id"
5252
else
5353
echo -e "${RED}Unable to run the console locally. May this port is in usage already.${RESET}"
5454
echo -e "${RED}Check if the OLM is not accessible via web console at: http://localhost:9000/${RESET}"

0 commit comments

Comments
 (0)