mirror of
				https://github.com/optim-enterprises-bv/kubernetes.git
				synced 2025-11-04 04:08:16 +00:00 
			
		
		
		
	Merge pull request #45537 from shyamjvs/yolo
Automatic merge from submit-queue (batch tested with PRs 44798, 45537, 45448, 45432) Stream output of run-gcloud-compute-with-retries to stdout in realtime Ref https://github.com/kubernetes/kubernetes/issues/40139#issuecomment-299894222 (3rd point) This should help us get more info about timeouts during start-kubemark-master.sh. cc @wojtek-t @gmarek
This commit is contained in:
		@@ -20,8 +20,10 @@
 | 
				
			|||||||
function run-gcloud-compute-with-retries {
 | 
					function run-gcloud-compute-with-retries {
 | 
				
			||||||
  RETRIES="${RETRIES:-3}"
 | 
					  RETRIES="${RETRIES:-3}"
 | 
				
			||||||
  for attempt in $(seq 1 ${RETRIES}); do
 | 
					  for attempt in $(seq 1 ${RETRIES}); do
 | 
				
			||||||
 | 
					    exec 5>&1  # Duplicate &1 to &5 for use below.
 | 
				
			||||||
    # We don't use 'local' to declare gcloud_result as then ret_val always gets value 0.
 | 
					    # We don't use 'local' to declare gcloud_result as then ret_val always gets value 0.
 | 
				
			||||||
    gcloud_result=$(gcloud compute "$@" 2>&1) || local ret_val="$?"
 | 
					    # We use tee to output to &5 (redirected to stdout) while also storing it in the variable.
 | 
				
			||||||
 | 
					    gcloud_result=$(gcloud compute "$@" |& tee >(cat - >&5)) || local ret_val="$?"
 | 
				
			||||||
    echo "${gcloud_result}"
 | 
					    echo "${gcloud_result}"
 | 
				
			||||||
    if [[ "${ret_val:-0}" -ne "0" ]]; then
 | 
					    if [[ "${ret_val:-0}" -ne "0" ]]; then
 | 
				
			||||||
      if [[ $(echo "${gcloud_result}" | grep -c "already exists") -gt 0 ]]; then
 | 
					      if [[ $(echo "${gcloud_result}" | grep -c "already exists") -gt 0 ]]; then
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user