Fix container name used in kube log output

Signed-off-by: Michael Irwin <mikesir87@gmail.com>
This commit is contained in:
Michael Irwin 2021-07-08 22:04:01 -04:00
parent ed0b123b75
commit 8c5b970376
No known key found for this signature in database
GPG Key ID: 8C42FBB0E482C8CF
1 changed files with 3 additions and 2 deletions

View File

@ -210,10 +210,11 @@ func (kc *KubeClient) GetLogs(ctx context.Context, projectName string, consumer
}
eg, ctx := errgroup.WithContext(ctx)
for _, pod := range pods.Items {
request := kc.client.CoreV1().Pods(kc.namespace).GetLogs(pod.Name, &corev1.PodLogOptions{Follow: follow})
podName := pod.Name
request := kc.client.CoreV1().Pods(kc.namespace).GetLogs(podName, &corev1.PodLogOptions{Follow: follow})
service := pod.Labels[api.ServiceLabel]
w := utils.GetWriter(func(line string) {
consumer.Log(pod.Name, service, line)
consumer.Log(podName, service, line)
})
eg.Go(func() error {