Skip to content

Commit

Permalink
Fix mac k8s connection tests (#58)
Browse files Browse the repository at this point in the history
* add retry

* update version
  • Loading branch information
ShiranAvidov authored Dec 6, 2022
1 parent eb9ba7a commit fbcbcc2
Show file tree
Hide file tree
Showing 4 changed files with 79 additions and 19 deletions.
32 changes: 26 additions & 6 deletions Kubernetes/AKS/Kubernetes/prerequisites/mac/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/mac/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/mac/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
2 changes: 1 addition & 1 deletion scripts/windows/agent.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,7 @@ function Write-AgentSupport {


# Agent version
$script:AgentVersion = 'v1.0.27'
$script:AgentVersion = 'v1.0.29'

# Settings
$ProgressPreference = 'SilentlyContinue'
Expand Down

0 comments on commit fbcbcc2

Please sign in to comment.