Skip to content
This repository has been archived by the owner on May 24, 2023. It is now read-only.

Add Regex support to OMPS #95

Merged
merged 1 commit into from
Oct 9, 2019

Conversation

rthallisey
Copy link
Contributor

The current pattern for registry string replacement only matches on whole
strings. This pattern is very broad and lacks the precision to handle corner
cases like strings that only end or begin with '/'. Regexes provide the
precision needed to expand pattern matching to handle more precise string replacement.

omps/quay.py Outdated
@@ -259,7 +259,12 @@ def replace_registries(self, text):
for conf in self._replace_registry_conf:
old = conf['old']
new = conf['new']
if old in text:
regexp = conf['regexp']
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'd like to have 'regexp' optional, respectively only old or regexp must be defined, not both, not none.

omps/quay.py Outdated Show resolved Hide resolved
omps/quay.py Show resolved Hide resolved
example.test.env.yaml Outdated Show resolved Hide resolved
omps/quay.py Outdated Show resolved Hide resolved
tests/test_quay.py Outdated Show resolved Hide resolved
tests/test_settings.py Outdated Show resolved Hide resolved
tests/test_settings.py Outdated Show resolved Hide resolved
README.md Outdated Show resolved Hide resolved
Copy link
Contributor

@csomh csomh left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks good, but please squash the commits before merging.

Thanks @rthallisey!

The current pattern for registry string replacement only matches on whole
strings.  This pattern is very broad and lacks the precision to handle corner
cases like strings that only end or begin with '/'.  Regexes provide the
precision needed to expand pattern matching to handle more precise string replacement.

Make regexp backwards compatible

Change strings to bools
@rthallisey
Copy link
Contributor Author

Thanks @csomh & @MartinBasti!

@ralphbean ralphbean merged commit becf6c6 into release-engineering:master Oct 9, 2019
@ralphbean
Copy link
Member

@rthallisey rthallisey deleted the regex-support branch October 9, 2019 20:42
@ralphbean
Copy link
Member

Deployed to the QA environment.

@ralphbean
Copy link
Member

Going to hold off on promoting this to prod to minimize any side-effects we might have on other releases scheduled for next week.

@csomh
Copy link
Contributor

csomh commented Oct 10, 2019

Integration tests passed on QA.

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

Successfully merging this pull request may close these issues.

4 participants