GH-7196: More lenient regex for container image templating#3421
Merged
pingsutw merged 5 commits intoflyteorg:masterfrom Apr 10, 2026
Conversation
Signed-off-by: Thomas Newton <thomas.w.newton@gmail.com>
Signed-off-by: Thomas Newton <thomas.w.newton@gmail.com>
Signed-off-by: Thomas Newton <thomas.w.newton@gmail.com>
Tom-Newton
commented
Apr 10, 2026
| # With empty attribute, it'll access the full image path (e.g. registry/imagename:version -> registry/imagename:version) | ||
| _IMAGE_REPLACE_REGEX = re.compile(r"({{\s*\.image[s]?(?:\.([a-zA-Z0-9_]+))(?:\.([a-zA-Z0-9_]+))?\s*}})", re.IGNORECASE) | ||
| _IMAGE_TEMPLATE_SUBSTRING_REGEX = r"(?:\.([a-zA-Z0-9_-]+))" | ||
| _IMAGE_REPLACE_REGEX = re.compile(f"({{{{\s*\.image[s]?{_IMAGE_TEMPLATE_SUBSTRING_REGEX}{_IMAGE_TEMPLATE_SUBSTRING_REGEX}?\s*}}}})", re.IGNORECASE) |
Contributor
Author
There was a problem hiding this comment.
Making this an f-string creates escaping complexity but IMO it was worthwhile to reduce some duplication.
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #3421 +/- ##
===========================================
+ Coverage 45.78% 76.47% +30.69%
===========================================
Files 317 217 -100
Lines 28359 22848 -5511
Branches 3015 3015
===========================================
+ Hits 12983 17474 +4491
+ Misses 15278 4559 -10719
- Partials 98 815 +717 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
Signed-off-by: Thomas Newton <thomas.w.newton@gmail.com>
pingsutw
approved these changes
Apr 10, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Tracking issue
flyteorg/flyte#7196
Why are the changes needed?
Something that I fully expected to work didn't work and it took me hours to debug.
What changes were proposed in this pull request?
How was this patch tested?
Updated unittests
Check all the applicable boxes