mirror of
				https://github.com/optim-enterprises-bv/kubernetes.git
				synced 2025-11-04 12:18:16 +00:00 
			
		
		
		
	Make validate cluster more reliable (it should retry checking the
server if a subshell returns a non-zero exit status).
This commit is contained in:
		@@ -49,7 +49,7 @@ cat -n "${MINIONS_FILE}"
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
attempt=0
 | 
					attempt=0
 | 
				
			||||||
while true; do
 | 
					while true; do
 | 
				
			||||||
  kubectl_output=$("${KUBE_ROOT}/cluster/kubectl.sh" get cs)
 | 
					  kubectl_output=$("${KUBE_ROOT}/cluster/kubectl.sh" get cs) || true
 | 
				
			||||||
 | 
					
 | 
				
			||||||
  # The "kubectl componentstatuses" output is four columns like this:
 | 
					  # The "kubectl componentstatuses" output is four columns like this:
 | 
				
			||||||
  #
 | 
					  #
 | 
				
			||||||
@@ -61,7 +61,7 @@ while true; do
 | 
				
			|||||||
  # Because of the header, the actual unsuccessful count is 1 minus the count.
 | 
					  # Because of the header, the actual unsuccessful count is 1 minus the count.
 | 
				
			||||||
  non_success_count=$(echo "${kubectl_output}" | \
 | 
					  non_success_count=$(echo "${kubectl_output}" | \
 | 
				
			||||||
    sed -n 's/^[[:alnum:][:punct:]]/&/p' | \
 | 
					    sed -n 's/^[[:alnum:][:punct:]]/&/p' | \
 | 
				
			||||||
    grep --invert-match -c '^[[:alnum:][:punct:]]\{1,\}[[:space:]]\{1,\}Healthy')
 | 
					    grep --invert-match -c '^[[:alnum:][:punct:]]\{1,\}[[:space:]]\{1,\}Healthy') || true
 | 
				
			||||||
 | 
					
 | 
				
			||||||
  if ((non_success_count > 1)); then
 | 
					  if ((non_success_count > 1)); then
 | 
				
			||||||
    if ((attempt < 5)); then
 | 
					    if ((attempt < 5)); then
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user