Skip to content

Commit d7dd663

Browse files
committed
Merge pull request kubernetes#20412 from gmarek/enable
Add a flag to allow non-fatal errors in validate-cluster
2 parents 0e396b2 + efacc04 commit d7dd663

File tree

2 files changed

+15
-1
lines changed

2 files changed

+15
-1
lines changed

cluster/kube-up.sh

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@ set -o nounset
2525
set -o pipefail
2626

2727
KUBE_ROOT=$(dirname "${BASH_SOURCE}")/..
28+
EXIT_ON_WEAK_ERROR="${EXIT_ON_WEAK_ERROR:-true}"
2829

2930
if [ -f "${KUBE_ROOT}/cluster/env.sh" ]; then
3031
source "${KUBE_ROOT}/cluster/env.sh"
@@ -47,7 +48,18 @@ echo "... calling kube-up" >&2
4748
kube-up
4849

4950
echo "... calling validate-cluster" >&2
50-
validate-cluster
51+
if [[ "${EXIT_ON_WEAK_ERROR}" == "true" ]]; then
52+
validate-cluster
53+
else
54+
if ! validate-cluster; then
55+
local validate_result="$?"
56+
if [[ "${validate_result}" == "1" ]]; then
57+
exit 1
58+
elif [[ "${validate_result}" == "2" ]]; then
59+
echo "...ignoring non-fatal errors in validate-cluster" >&2
60+
fi
61+
fi
62+
fi
5163

5264
echo -e "Done, listing cluster services:\n" >&2
5365
"${KUBE_ROOT}/cluster/kubectl.sh" cluster-info

hack/jenkins/e2e.sh

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -553,6 +553,7 @@ case ${JOB_NAME} in
553553
NODE_DISK_SIZE="50GB"
554554
NUM_NODES="1000"
555555
ALLOWED_NOTREADY_NODES="2"
556+
EXIT_ON_WEAK_ERROR="false"
556557
# Reduce logs verbosity
557558
TEST_CLUSTER_LOG_LEVEL="--v=1"
558559
# Increase resync period to simulate production
@@ -953,6 +954,7 @@ export KUBE_OS_DISTRIBUTION=${KUBE_OS_DISTRIBUTION:-}
953954
export GCE_SERVICE_ACCOUNT=$(gcloud auth list 2> /dev/null | grep active | cut -f3 -d' ')
954955
export FAIL_ON_GCP_RESOURCE_LEAK="${FAIL_ON_GCP_RESOURCE_LEAK:-false}"
955956
export ALLOWED_NOTREADY_NODES=${ALLOWED_NOTREADY_NODES:-}
957+
export EXIT_ON_WEAK_ERROR=${EXIT_ON_WEAK_ERROR:-}
956958

957959
# GKE variables
958960
export CLUSTER_NAME=${E2E_CLUSTER_NAME}

0 commit comments

Comments
 (0)