Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

re2: pattern trimming causes issues with trailing characters #183

Open
nvpivot opened this issue Oct 30, 2020 · 1 comment
Open

re2: pattern trimming causes issues with trailing characters #183

nvpivot opened this issue Oct 30, 2020 · 1 comment
Assignees

Comments

@nvpivot
Copy link

nvpivot commented Oct 30, 2020

We ran into an issue when using pattern recognition on a value that had the last character of the number 2.

Example:
re2: ^myregex2
Will result in ^myregex without the "2"

The strings.Trim(mystring, 123g) will strip the characters 1,2,3, and g from 'mystring'. So presumably, folks would hit an issue if 'r,e,2, or :' are the last character of the regex pattern.

Suggest changing this line in (https://github.com/alexei-led/pumba/blob/master/pkg/chaos/command.go)
pattern = strings.Trim(first, Re2Prefix)
TO
pattern = strings.TrimSpace(strings.TrimPrefix(first, Re2Prefix))

@alexei-led
Copy link
Owner

@nvpivot Thank you for issue report. Definitely a bug.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants