Skip to content

Commit 5952528

Browse files
committed
update test
1 parent 7f91cbe commit 5952528

File tree

1 file changed

+16
-9
lines changed

1 file changed

+16
-9
lines changed

test/e2e/scaffold/scaffold.go

Lines changed: 16 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -220,16 +220,23 @@ func (s *Scaffold) GetDeploymentLogs(name string) string {
220220
var buf strings.Builder
221221
for _, pod := range pods.Items {
222222
buf.WriteString(fmt.Sprintf("=== pod: %s ===\n", pod.Name))
223-
logs, err := cli.CoreV1().RESTClient().Get().
224-
Resource("pods").
225-
Namespace(s.namespace).
226-
Name(pod.Name).SubResource("log").
227-
Do(context.TODO()).
228-
Raw()
229-
if err == nil {
230-
buf.Write(logs)
223+
for _, c := range pod.Spec.Containers {
224+
buf.WriteString(fmt.Sprintf("--- container: %s ---\n", c.Name))
225+
logs, err := cli.CoreV1().RESTClient().Get().
226+
Resource("pods").
227+
Namespace(s.namespace).
228+
Name(pod.Name).
229+
SubResource("log").
230+
Param("container", c.Name).
231+
Do(context.TODO()).
232+
Raw()
233+
if err == nil {
234+
buf.Write(logs)
235+
} else {
236+
buf.WriteString(fmt.Sprintf("Error getting logs: %v\n", err))
237+
}
238+
buf.WriteByte('\n')
231239
}
232-
buf.WriteByte('\n')
233240
}
234241
return buf.String()
235242
}

0 commit comments

Comments
 (0)