Skip to content

Commit

Permalink
Merge pull request #201 from Random-Liu/fix-cri-test-for-new-log
Browse files Browse the repository at this point in the history
Fix cri validation test to use new log format.
  • Loading branch information
Random-Liu authored Nov 21, 2017
2 parents 2dbb423 + 26218ed commit 4cd2b04
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions pkg/validate/container.go
Original file line number Diff line number Diff line change
Expand Up @@ -544,13 +544,14 @@ func parseDockerJSONLog(log []byte, msg *logMessage) {

// parseCRILog parses logs in CRI log format.
// CRI log format example :
// 2016-10-06T00:17:09.669794202Z stdout The content of the log entry 1
// 2016-10-06T00:17:10.113242941Z stderr The content of the log entry 2
// 2016-10-06T00:17:09.669794202Z stdout P The content of the log entry 1
// 2016-10-06T00:17:10.113242941Z stderr F The content of the log entry 2
func parseCRILog(log string, msg *logMessage) {
timeStamp, err := time.Parse(time.RFC3339Nano, strings.Fields(log)[0])
framework.ExpectNoError(err, "failed to parse timeStamp: %v", err)
stream := strings.Fields(log)[1]
logMessage := strings.Fields(log)[2:]
// Skip the tag field.
logMessage := strings.Fields(log)[3:]

msg.timestamp = timeStamp
msg.stream = streamType(stream)
Expand Down

0 comments on commit 4cd2b04

Please sign in to comment.