-
Notifications
You must be signed in to change notification settings - Fork 154
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: Outdated image string join logic in ImageRow.image_ref
#3125
base: main
Are you sure you want to change the base?
Conversation
ImageRow.image_ref
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good. After this PR, let's refactor this codes by replacing split()
to partition()
and adding type hints to the join_non_empty()
function
@fregataa You might be referring to the following code. image_and_tag = self.name.partition(f"{join(self.registry, self.project)}/")[2] |
image_and_tag = self.name.partition(f"{join(self.registry, self.project)}/")[2] # This is okay but
_, _, image_and_tag = self.name.partition(f"{join(self.registry, self.project)}/") # I recommend to use this pattern with partition() |
Thanks for your description! I will reflect this. |
Fixes #3126, follow-up to #2978.
Since
project
value was changed to be nullable in PR #2978, theimage
string join logic also should be updated.Why?
For example, if the
registry
is "abc" and theproject
is "", thenf"{self.registry}/{self.project}/"
becomes "abc//". (Expected result: "abc/")Checklist: (if applicable)