mirror of
				https://github.com/optim-enterprises-bv/kubernetes.git
				synced 2025-11-03 19:58:17 +00:00 
			
		
		
		
	Indicate progress when doing a go build
It is slow.
This commit is contained in:
		@@ -295,6 +295,7 @@ kube::golang::build_binaries_for_platform() {
 | 
				
			|||||||
      output_path="${output_path}/${platform//\//_}"
 | 
					      output_path="${output_path}/${platform//\//_}"
 | 
				
			||||||
    fi
 | 
					    fi
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    kube::log::progress "    "
 | 
				
			||||||
    for binary in "${binaries[@]}"; do
 | 
					    for binary in "${binaries[@]}"; do
 | 
				
			||||||
      local bin=$(basename "${binary}")
 | 
					      local bin=$(basename "${binary}")
 | 
				
			||||||
      if [[ ${GOOS} == "windows" ]]; then
 | 
					      if [[ ${GOOS} == "windows" ]]; then
 | 
				
			||||||
@@ -312,7 +313,9 @@ kube::golang::build_binaries_for_platform() {
 | 
				
			|||||||
          -ldflags "${version_ldflags}" \
 | 
					          -ldflags "${version_ldflags}" \
 | 
				
			||||||
          "${binary}"
 | 
					          "${binary}"
 | 
				
			||||||
      fi
 | 
					      fi
 | 
				
			||||||
 | 
					      kube::log::progress "*"
 | 
				
			||||||
    done
 | 
					    done
 | 
				
			||||||
 | 
					    kube::log::progress "\n"
 | 
				
			||||||
  else
 | 
					  else
 | 
				
			||||||
    # Use go install.
 | 
					    # Use go install.
 | 
				
			||||||
    if [[ "${#nonstatics[@]}" != 0 ]]; then
 | 
					    if [[ "${#nonstatics[@]}" != 0 ]]; then
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -119,6 +119,13 @@ kube::log::info() {
 | 
				
			|||||||
  done
 | 
					  done
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					# Just like kube::log::info, but no \n, so you can make a progress bar
 | 
				
			||||||
 | 
					kube::log::progress() {
 | 
				
			||||||
 | 
					  for message; do
 | 
				
			||||||
 | 
					    echo -e -n "$message"
 | 
				
			||||||
 | 
					  done
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
kube::log::info_from_stdin() {
 | 
					kube::log::info_from_stdin() {
 | 
				
			||||||
  local messages=()
 | 
					  local messages=()
 | 
				
			||||||
  while read -r line; do
 | 
					  while read -r line; do
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user