fix: logs — убрать хардкод user-container, взять первый контейнер пода (v1.3.62)

This commit is contained in:
“Naeel”
2026-05-07 20:58:23 +04:00
parent 9b0089e15a
commit af6e7354d6
3 changed files with 8 additions and 5 deletions
+2 -2
View File
@@ -22,10 +22,10 @@ import (
"fission-console/internal/model"
"fission-console/internal/runtime"
corev1 "k8s.io/api/core/v1"
apierrors "k8s.io/apimachinery/pkg/api/errors"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
"k8s.io/apimachinery/pkg/apis/meta/v1/unstructured"
corev1 "k8s.io/api/core/v1"
)
// validFuncName — RFC 1123 subdomain label: строчные буквы+цифры+дефис, без дефиса в начале/конце.
@@ -1651,8 +1651,8 @@ func (s *Server) handleGetFunctionLogs(w http.ResponseWriter, r *http.Request, n
var allLogs strings.Builder
tailLines := int64(100)
for _, pod := range pods.Items {
// Container не указываем — kubernetes берёт первый (environment container)
req := s.kube.CoreV1().Pods(ns).GetLogs(pod.Name, &corev1.PodLogOptions{
Container: "user-container",
TailLines: &tailLines,
})
rc, err := req.Stream(ctx)