Преглед изворни кода

add comment explaining ugly casing

Alexander Belanger пре 4 година
родитељ
комит
d409c5794d
1 измењених фајлова са 2 додато и 0 уклоњено
  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"),