Skip to content

Commit

Permalink
Merge pull request openshift#29340 from ardaguclu/ocpbugs-45363
Browse files Browse the repository at this point in the history
OCPBUGS-45363: Parse node logs also when encountered with standard html header
  • Loading branch information
openshift-merge-bot[bot] authored Dec 4, 2024
2 parents 7aa9208 + f367270 commit ab0ebfb
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion pkg/monitortestlibrary/nodeaccess/node_log.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,9 @@ func GetDirectoryListing(in io.Reader) ([]string, error) {

// turn href links into lines of output
content, _ := buf.Peek(bufferSize)
if bytes.HasPrefix(content, []byte("<pre>")) {
// Until Go 1.23, kubelet returned with the prefix <pre>, but now
// it returns with standard html prefix. We need to support both of them.
if bytes.HasPrefix(content, []byte("<pre>")) || bytes.HasPrefix(content, []byte("<!doctype html>")) {
reLink := regexp.MustCompile(`href="([^"]+)"`)
s := bufio.NewScanner(buf)
s.Split(func(data []byte, atEOF bool) (advance int, token []byte, err error) {
Expand Down

0 comments on commit ab0ebfb

Please sign in to comment.