fix: Wrong image name extraction logic
Existing code appears to assume the image name format is <registry URL>/<namespace>/<image>
https://github.com/lablup/backend.ai/blob/f16b76e81e357b2bd55da3b1dc7aa01b5eeccd26/src/ai/backend/manager/api/session.py#L1091-L1103
If the image name format is <registry URL>/<namespace>/<project>/<image>, this logic incorrectly extracts the image name.
For example,
>>> base_image_ref = "jopemachine/ghcr-test/python"
>>> new_name = base_image_ref.split("/", maxsplit=1)[1]
>>> new_name
'ghcr-test/python' # <project>/<image>
new_name includes not only the image name but also the project name.
As a result, in the logic that assigns new_canonical, the project name is included twice.
(like ghcr.io/jopemachine/ghcr-test/ghcr-test/python:3.9-ubuntu20.04)
Ref: #2341.
Checklist: (if applicable)
- [ ] Milestone metadata specifying the target backport version
📚 Documentation preview 📚: https://sorna--2391.org.readthedocs.build/en/2391/
📚 Documentation preview 📚: https://sorna-ko--2391.org.readthedocs.build/ko/2391/
Your org has enabled the Graphite merge queue for merging into main
Add the label “flow:merge-queue” to the PR and Graphite will automatically add it to the merge queue when it’s ready to merge. Or use the label “flow:hotfix” to add to the merge queue as a hot fix.
You must have a Graphite account and log in to Graphite in order to use the merge queue. Sign up using this link.
This stack of pull requests is managed by Graphite. Learn more about stacking.
Join @jopemachine and the rest of your teammates on
Graphite
Closing this PR because the logic for obtaining the image name is intentional.