Explorar o código

case on release not found in second place

Alexander Belanger %!s(int64=3) %!d(string=hai) anos
pai
achega
3360c2db7c
Modificáronse 1 ficheiros con 7 adicións e 1 borrados
  1. 7 1
      api/server/handlers/release/update_image_batch.go

+ 7 - 1
api/server/handlers/release/update_image_batch.go

@@ -81,6 +81,12 @@ func (c *UpdateImageBatchHandler) ServeHTTP(w http.ResponseWriter, r *http.Reque
 			rel, err := helmAgent.GetRelease(releases[index].Name, 0, false)
 
 			if err != nil {
+				// if this is a release not found error, just return - the release has likely been deleted from the underlying
+				// cluster but has not been deleted from the Porter database yet
+				if strings.Contains(err.Error(), "release: not found") {
+					return
+				}
+
 				mu.Lock()
 				errors = append(errors, fmt.Sprintf("Error for %s, index %d: %s", releases[index].Name, index, err.Error()))
 				mu.Unlock()
@@ -106,7 +112,7 @@ func (c *UpdateImageBatchHandler) ServeHTTP(w http.ResponseWriter, r *http.Reque
 
 				if err != nil {
 					// if this is a release not found error, just return - the release has likely been deleted from the underlying
-					// cluster but has not been deleted from the Porter database yet
+					// cluster in the time since we've read the release, but has not been deleted from the Porter database yet
 					if strings.Contains(err.Error(), "release: not found") {
 						return
 					}