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

Fix RegEx to allow any character in a template name #86

Conversation

dhaiducek
Copy link
Member

If an invalid character is provided in a template name, our RegEx was filtering it out and not handling it properly.

I'm not sure whether this is too broad and we might need something like non-whitespace ^\s or non-forward-slash ^/, but technically a user can put whatever they want in there, so it seemed like . might be most appropriate.

ref: https://issues.redhat.com/browse/ACM-7737

If an invalid character is provided in a template name, our RegEx was
filtering it out and not handling it properly.

ref: https://issues.redhat.com/browse/ACM-7737
Signed-off-by: Dale Haiducek <19750917+dhaiducek@users.noreply.github.com>
Signed-off-by: Dale Haiducek <19750917+dhaiducek@users.noreply.github.com>
@dhaiducek
Copy link
Member Author

The E2E tests failed because I was expecting only one history status and got 7. I've added logic here to not requeue when an error matching k8serrors.IsInvalid() occurs since it seems that's unrecoverable and shouldn't be tried again, but if that's too risky it's in a separate commit and can be removed.

@openshift-ci
Copy link

openshift-ci bot commented Sep 29, 2023

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: dhaiducek, gparvin

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@openshift-merge-robot openshift-merge-robot merged commit d684146 into open-cluster-management-io:main Sep 29, 2023
2 checks passed
@dhaiducek dhaiducek deleted the 7737-invalid-name branch September 29, 2023 15:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants