Sfoglia il codice sorgente

fix image update batch when release isn't found

Alexander Belanger 3 anni fa
parent
commit
2ca5082c02
1 ha cambiato i file con 6 aggiunte e 0 eliminazioni
  1. 6 0
      api/server/handlers/release/update_image_batch.go

+ 6 - 0
api/server/handlers/release/update_image_batch.go

@@ -105,6 +105,12 @@ func (c *UpdateImageBatchHandler) ServeHTTP(w http.ResponseWriter, r *http.Reque
 				_, err = helmAgent.UpgradeReleaseByValues(conf, c.Config().DOConf)
 
 				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()