Procházet zdrojové kódy

add comment explaining ugly casing

Alexander Belanger před 4 roky
rodič
revize
d409c5794d
1 změnil soubory, kde provedl 2 přidání a 0 odebrání
  1. 2 0
      api/server/authz/release.go

+ 2 - 0
api/server/authz/release.go

@@ -54,6 +54,8 @@ func (p *ReleaseScopedMiddleware) ServeHTTP(w http.ResponseWriter, r *http.Reque
 	release, err := helmAgent.GetRelease(name, int(version), false)
 
 	if err != nil {
+		// ugly casing since at the time of this commit Helm doesn't have an errors package.
+		// so we rely on the Helm error containing "not found"
 		if strings.Contains(err.Error(), "not found") {
 			apierrors.HandleAPIError(p.config, w, r, apierrors.NewErrPassThroughToClient(
 				fmt.Errorf("release not found"),