ソースを参照

cast resource type to lower for logs endpoint

Alexander Belanger 4 年 前
コミット
d2508a67fd
1 ファイル変更2 行追加1 行削除
  1. 2 1
      api/server/handlers/kube_events/get_logs.go

+ 2 - 1
api/server/handlers/kube_events/get_logs.go

@@ -3,6 +3,7 @@ package kube_events
 import (
 	"fmt"
 	"net/http"
+	"strings"
 
 	"github.com/porter-dev/porter/api/server/authz"
 	"github.com/porter-dev/porter/api/server/handlers"
@@ -44,7 +45,7 @@ func (c *GetKubeEventLogsHandler) ServeHTTP(w http.ResponseWriter, r *http.Reque
 	}
 
 	// if the kube event is not a pod type, throw a bad request error to the user
-	if kubeEvent.ResourceType != "pod" {
+	if strings.ToLower(kubeEvent.ResourceType) != "pod" {
 		c.HandleAPIError(w, r, apierrors.NewErrPassThroughToClient(
 			fmt.Errorf("event resource type must be pod to get logs"),
 			http.StatusBadRequest,