fix: logs — брать имя контейнера из pod.Spec.Containers[0] (v1.3.63)

This commit is contained in:
“Naeel”
2026-05-07 21:04:23 +04:00
parent af6e7354d6
commit 10cf4783a3
3 changed files with 8 additions and 4 deletions
+5 -1
View File
@@ -1651,8 +1651,12 @@ 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)
containerName := ""
if len(pod.Spec.Containers) > 0 {
containerName = pod.Spec.Containers[0].Name
}
req := s.kube.CoreV1().Pods(ns).GetLogs(pod.Name, &corev1.PodLogOptions{
Container: containerName,
TailLines: &tailLines,
})
rc, err := req.Stream(ctx)