canonical / opensearch-operator

OpenSearch operator
Apache License 2.0
12 stars 7 forks source link

[DPE-5677] Fix the append scenarios in replace() #484

Closed phvalguima closed 1 month ago

phvalguima commented 1 month ago

Update the replace() method to (1) be more "greedy" when searching for matches in the text, including multi-line matches; and (2) fix the write back to the file.

Currently, it is possible that, if we have a smaller size than the original file size, we will end up writing:

-> and this file still has the same size as it original. This PR simplifies the logic to decide how to write the changed content. Closes #483