Skip to content

CRI: Define CRI log format better #44976

Closed
@Random-Liu

Description

Current cri logging format doesn't mention how to handle new line in the log.

Currently, it seems that we assume that each cri log line corresponds to a container output line. In this way, we don't need to handle newline specially.

However, there are 2 problems:

  1. If the container only outputs one line without newline at the end, the log generated won't have newline, either. (cri-o hit this in their node e2e test)
  2. If the log line is too long, runtime usually has to split one line into several lines.

Both cases will confuse kubelet.

It would be better to:

  1. Let runtime escape all newlines in log content, and add newline to the end as part of CRI logging format.
  2. Let kubelet unespace the newlines inside the log content.

/cc @yujuhong @feiskyer @mrunalp /cc @kubernetes/sig-node-api-reviews

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions