This will fail as the second event does not match the pattern message.*.
To be able to match the it one would have to write it like .ofMessages("(?s)message.*") to allow . to match newlines too (DOTALL).
Now the question is whether we want to keep this on user's choice/knowledge to use correct patterns or whether we somehow enforce the XTF to always perform DOTALL matching in this case.
The expected solution of this is one of:
1) enforce DOTALL by default, update javadocs, extend tests
2) document current behaviour ~ update javadocs, extend tests
BTW I noticed this when hitting difference between OCP3 and OCP4 behavior which resulted in hours of debugging :exploding_head:
#OCP3 event message
message=Failed to pull image "helloworld-rs-app:latest": rpc error: code = Unknown desc = repository docker.io/helloworld-rs-app not found: does not exist or no pull access
#OCP4 event message
message=Failed to pull image "helloworld-rs-app:latest": rpc error: code = Unknown desc = reading manifest latest in docker.io/library/helloworld-rs-app: errors:
denied: requested access to the resource is denied
unauthorized: authentication required
There is a slightly non-obvious gotcha when one wants to filter Events by message and that message happens to be a multiline one
This will fail as the second event does not match the pattern
message.*
. To be able to match the it one would have to write it like.ofMessages("(?s)message.*")
to allow.
to match newlines too (DOTALL).Now the question is whether we want to keep this on user's choice/knowledge to use correct patterns or whether we somehow enforce the XTF to always perform DOTALL matching in this case.
The expected solution of this is one of: 1) enforce DOTALL by default, update javadocs, extend tests 2) document current behaviour ~ update javadocs, extend tests
BTW I noticed this when hitting difference between OCP3 and OCP4 behavior which resulted in hours of debugging :exploding_head: