-
Notifications
You must be signed in to change notification settings - Fork 14
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
test: fix unreliability, add checking if resource is available
kubectl wait is able to wait only for resource available on API
- Loading branch information
1 parent
df550bb
commit 4b0c230
Showing
4 changed files
with
60 additions
and
21 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
#!/usr/bin/env bash | ||
|
||
function wait_for_pod() { | ||
local namespace="$1" | ||
local pod="$2" | ||
local time="$3" | ||
local state="Running" | ||
|
||
for i in $(seq 0 $time) | ||
do | ||
get="$(kubectl get pods -n $namespace $pod)" | ||
if [[ ! $get =~ $state ]]; then | ||
echo "Waiting for pod $pod in $i interation" | ||
sleep 1 | ||
else | ||
echo "Found pod $pod" | ||
break | ||
fi | ||
done | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters