fix: logs — брать имя контейнера из pod.Spec.Containers[0] (v1.3.63)
This commit is contained in:
@@ -55,7 +55,7 @@ spec:
|
|||||||
serviceAccountName: fission-console
|
serviceAccountName: fission-console
|
||||||
containers:
|
containers:
|
||||||
- name: console
|
- name: console
|
||||||
image: naeel/fission-console:v1.3.62
|
image: naeel/fission-console:v1.3.63
|
||||||
imagePullPolicy: Always
|
imagePullPolicy: Always
|
||||||
ports:
|
ports:
|
||||||
- containerPort: 8090
|
- containerPort: 8090
|
||||||
|
|||||||
@@ -1651,8 +1651,12 @@ func (s *Server) handleGetFunctionLogs(w http.ResponseWriter, r *http.Request, n
|
|||||||
var allLogs strings.Builder
|
var allLogs strings.Builder
|
||||||
tailLines := int64(100)
|
tailLines := int64(100)
|
||||||
for _, pod := range pods.Items {
|
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{
|
req := s.kube.CoreV1().Pods(ns).GetLogs(pod.Name, &corev1.PodLogOptions{
|
||||||
|
Container: containerName,
|
||||||
TailLines: &tailLines,
|
TailLines: &tailLines,
|
||||||
})
|
})
|
||||||
rc, err := req.Stream(ctx)
|
rc, err := req.Stream(ctx)
|
||||||
|
|||||||
@@ -102,7 +102,7 @@
|
|||||||
<div class="nubes">NUBES</div>
|
<div class="nubes">NUBES</div>
|
||||||
<div class="product">FISSION CONSOLE</div>
|
<div class="product">FISSION CONSOLE</div>
|
||||||
</div>
|
</div>
|
||||||
<div style="font-size:0.65rem; color:var(--text-secondary); margin-left:10px; align-self:center; opacity:0.7;">v1.3.62</div>
|
<div style="font-size:0.65rem; color:var(--text-secondary); margin-left:10px; align-self:center; opacity:0.7;">v1.3.63</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="row" style="margin:0;">
|
<div class="row" style="margin:0;">
|
||||||
<button class="btn ghost" onclick="reloadAll()">Refresh</button>
|
<button class="btn ghost" onclick="reloadAll()">Refresh</button>
|
||||||
@@ -474,7 +474,7 @@
|
|||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="actions" style="justify-content:space-between; align-items:center;">
|
<div class="actions" style="justify-content:space-between; align-items:center;">
|
||||||
<span style="font-size:0.75rem; color:var(--text-secondary);">v1.3.62</span>
|
<span style="font-size:0.75rem; color:var(--text-secondary);">v1.3.63</span>
|
||||||
<button class="btn ghost" onclick="closeHelp()">Закрыть</button>
|
<button class="btn ghost" onclick="closeHelp()">Закрыть</button>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
Reference in New Issue
Block a user