mirror of
https://github.com/docker/compose.git
synced 2025-07-26 07:04:32 +02:00
Merge pull request #1906 from mikesir87/fix-log-names
Fix container name used in kube log output
This commit is contained in:
commit
396d449d36
@ -210,10 +210,11 @@ func (kc *KubeClient) GetLogs(ctx context.Context, projectName string, consumer
|
|||||||
}
|
}
|
||||||
eg, ctx := errgroup.WithContext(ctx)
|
eg, ctx := errgroup.WithContext(ctx)
|
||||||
for _, pod := range pods.Items {
|
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]
|
service := pod.Labels[api.ServiceLabel]
|
||||||
w := utils.GetWriter(func(line string) {
|
w := utils.GetWriter(func(line string) {
|
||||||
consumer.Log(pod.Name, service, line)
|
consumer.Log(podName, service, line)
|
||||||
})
|
})
|
||||||
|
|
||||||
eg.Go(func() error {
|
eg.Go(func() error {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user