From ede9e452114a0d1fe704d30e4f2269664d756274 Mon Sep 17 00:00:00 2001 From: Ryan Richard Date: Tue, 3 Dec 2024 17:20:25 -0600 Subject: [PATCH] make audit_test.go ignore pod log lines that aren't JSON --- test/integration/audit_test.go | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/test/integration/audit_test.go b/test/integration/audit_test.go index 335d09fd2..4e7cd7aef 100644 --- a/test/integration/audit_test.go +++ b/test/integration/audit_test.go @@ -741,6 +741,12 @@ func getFilteredAuditLogs( if len(podLog) == 0 { continue } + if !strings.HasPrefix(podLog, "{") { + // For some reason that needs investigation, an error message can appear in the pod log without + // being formatted as JSON. It starts with "http2: server: error reading preface from client". + // For now, just ignore it for the purposes of this test. + continue + } var deserializedPodLog map[string]any err = json.Unmarshal([]byte(podLog), &deserializedPodLog) require.NoErrorf(t, err, "error parsing line of pod log: %s", podLog)