From 4df5160bbd5e6738ab11aee88871b3b153dc9b9c Mon Sep 17 00:00:00 2001 From: Davlet Panech Date: Wed, 14 Feb 2024 09:57:57 -0500 Subject: [PATCH] stx-init-env: faster minikube status check Avoid "minikube profile list" when checking whether the profile exists. The list command attempts to connect to each profile and is quite slow. Use "minikube status -p $MINIKUBENAME" instead. Story: 2011038 Task: 49570 Signed-off-by: Davlet Panech Change-Id: If799840d749de00af907de7867ec68fb9908afa3 --- stx-init-env | 9 +-------- 1 file changed, 1 insertion(+), 8 deletions(-) diff --git a/stx-init-env b/stx-init-env index a848873b..cc5bb2f9 100755 --- a/stx-init-env +++ b/stx-init-env @@ -185,16 +185,9 @@ starts_with() { } minikube_profile_is_started() { - local result - result=$( - minikube profile list \ - | tr -d '|' \ - | awk -v profile="$MINIKUBENAME" '{ if ($1 == profile && $7 == "Running") print $1 }' - ) - [[ -n "$result" ]] + minikube status -p "$MINIKUBENAME" >/dev/null 2>&1 } - minikube_profile_exists() { local script=$(cat <<'END' import json,sys