Version
sbi version: main @ d9404ec
OS: N/A (pure string-parsing bug)
Go: 1.26.5
What happened?
ExtractRegistryAndRepo splits on the first :, which breaks digest-pinned references and host:port registries:
| Input |
Actual |
Expected |
mcr.microsoft.com/dotnet/aspnet:8.0@sha256:abc |
tag=8.0@sha256:abc |
tag=8.0 |
mcr.microsoft.com/dotnet/aspnet@sha256:abc |
repo ends with @sha256, tag=abc |
clean repo, empty tag |
localhost:5000/myrepo:1.0 |
reg=mcr.microsoft.com, tag=5000/myrepo:1.0 |
reg=localhost:5000, tag=1.0 |
This corrupts registry / repository / tag columns and can interact badly with UNIQUE(registry, repository, tag).
Expected: Parse like Docker references — strip @digest first; last : after last / is the tag; allow host:port registries.
Steps to reproduce
- Call
ExtractRegistryAndRepo with the inputs in the table above (unit test).
- Observe incorrect registry / repository / tag fields.
Version
sbi version: main @ d9404ec
OS: N/A (pure string-parsing bug)
Go: 1.26.5
What happened?
ExtractRegistryAndReposplits on the first:, which breaks digest-pinned references and host:port registries:mcr.microsoft.com/dotnet/aspnet:8.0@sha256:abc8.0@sha256:abc8.0mcr.microsoft.com/dotnet/aspnet@sha256:abc@sha256, tag=abclocalhost:5000/myrepo:1.0mcr.microsoft.com, tag=5000/myrepo:1.0localhost:5000, tag=1.0This corrupts
registry/repository/tagcolumns and can interact badly withUNIQUE(registry, repository, tag).Expected: Parse like Docker references — strip
@digestfirst; last:after last/is the tag; allowhost:portregistries.Steps to reproduce
ExtractRegistryAndRepowith the inputs in the table above (unit test).