Skip to content

Commit

Permalink
Merge pull request #537 from Vincent056/instruction_fix
Browse files Browse the repository at this point in the history
OCPBUGS-17828: Fix rule instruction
  • Loading branch information
openshift-merge-bot[bot] authored Jun 25, 2024
2 parents e8c8108 + a007722 commit 939659c
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions pkg/utils/parse_arf_result.go
Original file line number Diff line number Diff line change
Expand Up @@ -467,12 +467,15 @@ func GetInstructionsForRule(rule *xmlquery.Node, ocilTable NodeByIdHashTable, va
}

// if found, strip the last line
textSlice := strings.Split(strings.TrimSpace(textNodeStr), "\n")
textSlice := strings.Split(textNodeStr, "\n")
for i, line := range textSlice {
textSlice[i] = strings.TrimSpace(line)
}
if len(textSlice) > 1 {
textSlice = textSlice[:len(textSlice)-1]
}

return strings.TrimSpace(strings.Join(textSlice, "\n")), valuesRendered
return strings.Join(textSlice, "\n"), valuesRendered
}

// ParseContent parses the DataStream and returns the XML document
Expand Down

0 comments on commit 939659c

Please sign in to comment.