Skip to content

Commit a00d839

Browse files
committed
fix: include K6 helper pod logs in ChaosCenter backend
- CreatePodLog updated to fetch logs from helper pods if main container logs are missing - Ensures K6 load test results are correctly returned in ChaosCenter UI - Logs fallback to helper container if main container fails Signed-off-by: UJESH2K <[email protected]>
1 parent be0d53b commit a00d839

File tree

1 file changed

+5
-0
lines changed
  • chaoscenter/subscriber/pkg/k8s

1 file changed

+5
-0
lines changed

chaoscenter/subscriber/pkg/k8s/log.go

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,11 @@ func (k8s *k8sSubscriber) GetLogs(podName, namespace, container string) (string,
5656
func (k8s *k8sSubscriber) CreatePodLog(podLog types.PodLogRequest) (types.PodLog, error) {
5757
logDetails := types.PodLog{}
5858
mainLog, err := k8s.GetLogs(podLog.PodName, podLog.PodNamespace, "main")
59+
if err != nil {
60+
logrus.Warnf("main container log not found, retrying helper container for pod %v", podLog.PodName)
61+
mainLog, err = k8s.GetLogs(podLog.PodName, podLog.PodNamespace, "")
62+
}
63+
5964
// try getting argo pod logs
6065
if err != nil {
6166
logrus.Errorf("Failed to get argo pod %v logs, err: %v", podLog.PodName, err)

0 commit comments

Comments
 (0)