Closed
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:
- 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)
- 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:
- Let runtime escape all newlines in log content, and add newline to the end as part of CRI logging format.
- Let kubelet unespace the newlines inside the log content.
/cc @yujuhong @feiskyer @mrunalp /cc @kubernetes/sig-node-api-reviews