Browse Source

Merge pull request #1906 from mikesir87/fix-log-names

Fix container name used in kube log output
Mathieu Champlon 4 years ago
parent
commit
396d449d36
1 changed files with 3 additions and 2 deletions
  1. 3 2
      kube/client/client.go

+ 3 - 2
kube/client/client.go

@@ -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 {