Merge "Use executor with timeout for initinfra-networking phases"
This commit is contained in:
commit
e24a53713e
@ -14,23 +14,16 @@
|
|||||||
|
|
||||||
set -xe
|
set -xe
|
||||||
|
|
||||||
echo "Wait for Calico to be deployed using tigera" 1>&2
|
export TIMEOUT=${TIMEOUT:-1000}
|
||||||
kubectl --kubeconfig $KUBECONFIG --context $KCTL_CONTEXT wait --all-namespaces --for=condition=Ready pods --all --timeout=1000s 1>&2
|
|
||||||
|
|
||||||
echo "Wait for Established condition of tigerastatus(CRD) to be true for tigerastatus(CR) to show up" 1>&2
|
echo "Wait $TIMEOUT seconds for tigera status to be in Available state." 1>&2
|
||||||
kubectl --kubeconfig $KUBECONFIG --context $KCTL_CONTEXT wait --for=condition=Established crd/tigerastatuses.operator.tigera.io --timeout=300s 1>&2
|
end=$(($(date +%s) + $TIMEOUT))
|
||||||
|
|
||||||
# Wait till CR(tigerastatus) shows up to query
|
until [ "$(kubectl --kubeconfig $KUBECONFIG --context $KCTL_CONTEXT wait --for=condition=Available --all tigerastatus 2>/dev/null)" ]; do
|
||||||
count=0
|
now=$(date +%s)
|
||||||
max_retry_attempts=150
|
if [ $now -gt $end ]; then
|
||||||
until [ "$(kubectl --kubeconfig $KUBECONFIG --context $KCTL_CONTEXT get tigerastatus 2>/dev/null)" ]; do
|
echo "Tigera status is not ready before TIMEOUT=$TIMEOUT" 1>&2
|
||||||
count=$((count + 1))
|
|
||||||
if [[ ${count} -eq "${max_retry_attempts}" ]]; then
|
|
||||||
echo 'Timed out waiting for tigerastatus' 1>&2
|
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
sleep 2
|
sleep 10
|
||||||
done
|
done
|
||||||
|
|
||||||
# Wait till condition is available for tigerastatus
|
|
||||||
kubectl --kubeconfig $KUBECONFIG --context $KCTL_CONTEXT wait --for=condition=Available tigerastatus --all --timeout=1000s 1>&2
|
|
||||||
|
@ -23,11 +23,23 @@ config:
|
|||||||
pruneOptions:
|
pruneOptions:
|
||||||
prune: false
|
prune: false
|
||||||
---
|
---
|
||||||
|
apiVersion: airshipit.org/v1alpha1
|
||||||
|
kind: KubernetesApply
|
||||||
|
metadata:
|
||||||
|
labels:
|
||||||
|
airshipit.org/deploy-k8s: "false"
|
||||||
|
name: kubernetes-apply-networking
|
||||||
|
config:
|
||||||
|
waitOptions:
|
||||||
|
timeout: 1000
|
||||||
|
pruneOptions:
|
||||||
|
prune: false
|
||||||
|
---
|
||||||
# This is added to support phase with no-wait
|
# This is added to support phase with no-wait
|
||||||
# When there is a wait, then it does status-check and fails
|
# When there is a wait, then it does status-check and fails
|
||||||
# if the resource status(condition) is not met.
|
# if the resource status(condition) is not met.
|
||||||
# There are cases where the resource do not have status
|
# There are cases where the resource do not have status
|
||||||
# field implemeneted. So a wait will fail with status check
|
# field implemented. So a wait will fail with status check
|
||||||
apiVersion: airshipit.org/v1alpha1
|
apiVersion: airshipit.org/v1alpha1
|
||||||
kind: KubernetesApply
|
kind: KubernetesApply
|
||||||
metadata:
|
metadata:
|
||||||
|
@ -19,7 +19,7 @@ config:
|
|||||||
executorRef:
|
executorRef:
|
||||||
apiVersion: airshipit.org/v1alpha1
|
apiVersion: airshipit.org/v1alpha1
|
||||||
kind: KubernetesApply
|
kind: KubernetesApply
|
||||||
name: kubernetes-apply-nowait
|
name: kubernetes-apply-networking
|
||||||
documentEntryPoint: ephemeral/initinfra-networking
|
documentEntryPoint: ephemeral/initinfra-networking
|
||||||
---
|
---
|
||||||
apiVersion: airshipit.org/v1alpha1
|
apiVersion: airshipit.org/v1alpha1
|
||||||
@ -57,7 +57,7 @@ config:
|
|||||||
executorRef:
|
executorRef:
|
||||||
apiVersion: airshipit.org/v1alpha1
|
apiVersion: airshipit.org/v1alpha1
|
||||||
kind: KubernetesApply
|
kind: KubernetesApply
|
||||||
name: kubernetes-apply-nowait
|
name: kubernetes-apply-networking
|
||||||
documentEntryPoint: target/initinfra-networking
|
documentEntryPoint: target/initinfra-networking
|
||||||
---
|
---
|
||||||
apiVersion: airshipit.org/v1alpha1
|
apiVersion: airshipit.org/v1alpha1
|
||||||
|
Loading…
Reference in New Issue
Block a user