Skip to content

Commit

Permalink
increase sleep (#51)
Browse files Browse the repository at this point in the history
* increase sleep

* retry

* fix

* fix

* test

* test

* fix
  • Loading branch information
ShiranAvidov authored Nov 27, 2022
1 parent ab13429 commit 465423c
Show file tree
Hide file tree
Showing 3 changed files with 78 additions and 18 deletions.
32 changes: 26 additions & 6 deletions Kubernetes/AKS/Kubernetes/prerequisites/linux/functions.bash
Original file line number Diff line number Diff line change
Expand Up @@ -73,10 +73,20 @@ function can_k8s_cluster_connect_to_logzio_logs () {
return 3
fi

sleep 5
local is_pod_completed=false
local retries=3
while [[ $retries -ne 0 ]]; do
local pod_status=$(kubectl get pods | grep logzio-logs-connection-test | tr -s ' ' | cut -d ' ' -f3)
if [[ "$pod_status" == "Completed" ]]; then
is_pod_completed=true
break
fi

sleep 5
((retries--))
done

local pod_status=$(kubectl get pods | grep logzio-logs-connection-test | tr -s ' ' | cut -d ' ' -f3)
if [[ "$pod_status" != "Completed" ]]; then
if ! $is_pod_completed; then
local pod_logs=$(kubectl logs logzio-logs-connection-test 2>$task_error_file)
local err=$(cat $task_error_file)

Expand Down Expand Up @@ -129,10 +139,20 @@ function can_k8s_cluster_connect_to_logzio_metrics () {
return 3
fi

sleep 5
local is_pod_completed=false
local retries=3
while [[ $retries -ne 0 ]]; do
local pod_status=$(kubectl get pods | grep logzio-metrics-connection-test | tr -s ' ' | cut -d ' ' -f3)
if [[ "$pod_status" == "Completed" ]]; then
is_pod_completed=true
break
fi

sleep 5
((retries--))
done

local pod_status=$(kubectl get pods | grep logzio-metrics-connection-test | tr -s ' ' | cut -d ' ' -f3)
if [[ "$pod_status" != "Completed" ]]; then
if ! $is_pod_completed; then
local pod_logs=$(kubectl logs logzio-metrics-connection-test 2>$task_error_file)
local err=$(cat $task_error_file)

Expand Down
32 changes: 26 additions & 6 deletions Kubernetes/EKS/Kubernetes/prerequisites/linux/functions.bash
Original file line number Diff line number Diff line change
Expand Up @@ -73,10 +73,20 @@ function can_k8s_cluster_connect_to_logzio_logs () {
return 3
fi

sleep 5
local is_pod_completed=false
local retries=3
while [[ $retries -ne 0 ]]; do
local pod_status=$(kubectl get pods | grep logzio-logs-connection-test | tr -s ' ' | cut -d ' ' -f3)
if [[ "$pod_status" == "Completed" ]]; then
is_pod_completed=true
break
fi

sleep 5
((retries--))
done

local pod_status=$(kubectl get pods | grep logzio-logs-connection-test | tr -s ' ' | cut -d ' ' -f3)
if [[ "$pod_status" != "Completed" ]]; then
if ! $is_pod_completed; then
local pod_logs=$(kubectl logs logzio-logs-connection-test 2>$task_error_file)
local err=$(cat $task_error_file)

Expand Down Expand Up @@ -129,10 +139,20 @@ function can_k8s_cluster_connect_to_logzio_metrics () {
return 3
fi

sleep 5
local is_pod_completed=false
local retries=3
while [[ $retries -ne 0 ]]; do
local pod_status=$(kubectl get pods | grep logzio-metrics-connection-test | tr -s ' ' | cut -d ' ' -f3)
if [[ "$pod_status" == "Completed" ]]; then
is_pod_completed=true
break
fi

sleep 5
((retries--))
done

local pod_status=$(kubectl get pods | grep logzio-metrics-connection-test | tr -s ' ' | cut -d ' ' -f3)
if [[ "$pod_status" != "Completed" ]]; then
if ! $is_pod_completed; then
local pod_logs=$(kubectl logs logzio-metrics-connection-test 2>$task_error_file)
local err=$(cat $task_error_file)

Expand Down
32 changes: 26 additions & 6 deletions Kubernetes/GKE/Kubernetes/prerequisites/linux/functions.bash
Original file line number Diff line number Diff line change
Expand Up @@ -81,10 +81,20 @@ function can_k8s_cluster_connect_to_logzio_logs () {
return 3
fi

sleep 5
local is_pod_completed=false
local retries=3
while [[ $retries -ne 0 ]]; do
local pod_status=$(kubectl get pods | grep logzio-logs-connection-test | tr -s ' ' | cut -d ' ' -f3)
if [[ "$pod_status" == "Completed" ]]; then
is_pod_completed=true
break
fi

sleep 5
((retries--))
done

local pod_status=$(kubectl get pods | grep logzio-logs-connection-test | tr -s ' ' | cut -d ' ' -f3)
if [[ "$pod_status" != "Completed" ]]; then
if ! $is_pod_completed; then
local pod_logs=$(kubectl logs logzio-logs-connection-test 2>$task_error_file)
local err=$(cat $task_error_file)

Expand Down Expand Up @@ -141,10 +151,20 @@ function can_k8s_cluster_connect_to_logzio_metrics () {
return 3
fi

sleep 5
local is_pod_completed=false
local retries=3
while [[ $retries -ne 0 ]]; do
local pod_status=$(kubectl get pods | grep logzio-metrics-connection-test | tr -s ' ' | cut -d ' ' -f3)
if [[ "$pod_status" == "Completed" ]]; then
is_pod_completed=true
break
fi

sleep 5
((retries--))
done

local pod_status=$(kubectl get pods | grep logzio-metrics-connection-test | tr -s ' ' | cut -d ' ' -f3)
if [[ "$pod_status" != "Completed" ]]; then
if ! $is_pod_completed; then
local pod_logs=$(kubectl logs logzio-metrics-connection-test 2>$task_error_file)
local err=$(cat $task_error_file)

Expand Down

0 comments on commit 465423c

Please sign in to comment.