mirror of
				https://github.com/optim-enterprises-bv/kubernetes.git
				synced 2025-11-03 19:58:17 +00:00 
			
		
		
		
	Merge pull request #31478 from david-mcmahon/fix-cache-gen
Automatic merge from submit-queue Fix the creation of the jobResultsCache.json file. Let's try this again. ref https://github.com/kubernetes/release/pull/60
This commit is contained in:
		@@ -156,23 +156,23 @@ function update_job_result_cache() {
 | 
			
		||||
 | 
			
		||||
  for upload_attempt in $(seq 3); do
 | 
			
		||||
    echo "Copying ${job_results} to ${tmp_results} (attempt ${upload_attempt})"
 | 
			
		||||
    # The sed construct below is stripping out only the "version" lines
 | 
			
		||||
    # and then ensuring there's a single comma at the end of the line.
 | 
			
		||||
    gsutil -q cat ${job_results} 2>&- |\
 | 
			
		||||
     sed -n 's/^\({"version".*}\),*/\1,/p' >> ${tmp_results} || continue
 | 
			
		||||
 | 
			
		||||
     sed -n 's/^\({"version".*}\),*/\1,/p' |\
 | 
			
		||||
     tail -${cache_size} >> ${tmp_results} || continue
 | 
			
		||||
    break
 | 
			
		||||
  done
 | 
			
		||||
 | 
			
		||||
  echo "{\"version\": \"${version}\", \"buildnumber\": \"${BUILD_NUMBER}\"," \
 | 
			
		||||
       "\"result\": \"${build_result}\"}" >> ${tmp_results}
 | 
			
		||||
 | 
			
		||||
  # JSON doesn't like terminating elements to contain a "," separator, so
 | 
			
		||||
  # terminate the elements with an empty one.
 | 
			
		||||
  echo -e "{}\n]" >> ${tmp_results}
 | 
			
		||||
  echo "]" >> ${tmp_results}
 | 
			
		||||
 | 
			
		||||
  for upload_attempt in $(seq 3); do
 | 
			
		||||
    echo "Copying ${tmp_results} to ${job_results} (attempt ${upload_attempt})"
 | 
			
		||||
    gsutil -q -h "Content-Type:application/json" cp -a "${gcs_acl}" \
 | 
			
		||||
           <(tail -${cache_size} ${tmp_results}) ${job_results} || continue
 | 
			
		||||
           ${tmp_results} ${job_results} || continue
 | 
			
		||||
    break
 | 
			
		||||
  done
 | 
			
		||||
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user