Skip to content

Commit

Permalink
Specify loggsaver in the runner to collect log from main container.
Browse files Browse the repository at this point in the history
This commit specifies the container to collect the logs from when
there are more than one run contaienrs exit.
  • Loading branch information
wanlin31 committed Apr 25, 2022
1 parent 6ac5536 commit 580727d
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion tools/runner/logsaver.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ import (
"strings"

grpcv1 "github.com/grpc/test-infra/api/v1"
"github.com/grpc/test-infra/config"
"github.com/grpc/test-infra/status"
corev1 "k8s.io/api/core/v1"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
Expand Down Expand Up @@ -79,7 +80,7 @@ func (ls *LogSaver) getTestPods(ctx context.Context, loadTest *grpcv1.LoadTest)
}

func (ls *LogSaver) getPodLogBuffer(ctx context.Context, pod *corev1.Pod) (*bytes.Buffer, error) {
req := ls.podsGetter.Pods(pod.Namespace).GetLogs(pod.Name, &corev1.PodLogOptions{})
req := ls.podsGetter.Pods(pod.Namespace).GetLogs(pod.Name, &corev1.PodLogOptions{Container: config.RunContainerName})
driverLogs, err := req.Stream(ctx)
if err != nil {
return nil, err
Expand Down

0 comments on commit 580727d

Please sign in to comment.