detached df21944

fix(images): handle digest-like image references in tag splitting

commit
df21944509a1f70762adcbe5712f2afc35016afb
author
brice · · 2026-02-08 09:36 UTC
committer
brice · · 2026-02-08 09:40 UTC
parent
c1743fe
signature
GPG VerifiedCD88F9E564E0102646FB6077A1A07C7C7C3E349D · arch-gpg Verified for the committer email
2 files · +5 -0
M internal/usecase/images/service.go +3 -0
@@ -351,6 +351,9 @@ func splitRepoTag(repoTag string) (string, string) {
351351 if repoTag == "" {
352352 return "", ""
353353 }
354+ if strings.Contains(repoTag, "@") {
355+ return repoTag, ""
356+ }
354357
355358 idx := strings.LastIndex(repoTag, ":")
356359 slashIdx := strings.LastIndex(repoTag, "/")
@@ -351,6 +351,9 @@ func splitRepoTag(repoTag string) (string, string) {
351 if repoTag == "" {351 if repoTag == "" {
352 return "", ""352 return "", ""
353 }353 }
354+ if strings.Contains(repoTag, "@") {
355+ return repoTag, ""
356+ }
354 357
355 idx := strings.LastIndex(repoTag, ":")358 idx := strings.LastIndex(repoTag, ":")
356 slashIdx := strings.LastIndex(repoTag, "/")359 slashIdx := strings.LastIndex(repoTag, "/")
M internal/usecase/images/service_test.go +2 -0
@@ -622,8 +622,10 @@ func TestSplitRepoTag(t *testing.T) {
622622 wantTag string
623623 }{
624624 {name: "repository and tag", input: "alpine:latest", wantRepo: "alpine", wantTag: "latest"},
625+ {name: "sha-like tag stays a tag", input: "image:sha256vdfhnijkvfedhbni", wantRepo: "image", wantTag: "sha256vdfhnijkvfedhbni"},
625626 {name: "registry port and tag", input: "localhost:5000/repo:v1", wantRepo: "localhost:5000/repo", wantTag: "v1"},
626627 {name: "registry port without tag", input: "localhost:5000/repo", wantRepo: "localhost:5000/repo", wantTag: ""},
628+ {name: "digest reference not split as tag", input: "image@sha256:abcdef012345", wantRepo: "image@sha256:abcdef012345", wantTag: ""},
627629 {name: "missing tag", input: "alpine", wantRepo: "alpine", wantTag: ""},
628630 {name: "trailing colon", input: "alpine:", wantRepo: "alpine:", wantTag: ""},
629631 }
@@ -622,8 +622,10 @@ func TestSplitRepoTag(t *testing.T) {
622 wantTag string622 wantTag string
623 }{623 }{
624 {name: "repository and tag", input: "alpine:latest", wantRepo: "alpine", wantTag: "latest"},624 {name: "repository and tag", input: "alpine:latest", wantRepo: "alpine", wantTag: "latest"},
625+ {name: "sha-like tag stays a tag", input: "image:sha256vdfhnijkvfedhbni", wantRepo: "image", wantTag: "sha256vdfhnijkvfedhbni"},
625 {name: "registry port and tag", input: "localhost:5000/repo:v1", wantRepo: "localhost:5000/repo", wantTag: "v1"},626 {name: "registry port and tag", input: "localhost:5000/repo:v1", wantRepo: "localhost:5000/repo", wantTag: "v1"},
626 {name: "registry port without tag", input: "localhost:5000/repo", wantRepo: "localhost:5000/repo", wantTag: ""},627 {name: "registry port without tag", input: "localhost:5000/repo", wantRepo: "localhost:5000/repo", wantTag: ""},
628+ {name: "digest reference not split as tag", input: "image@sha256:abcdef012345", wantRepo: "image@sha256:abcdef012345", wantTag: ""},
627 {name: "missing tag", input: "alpine", wantRepo: "alpine", wantTag: ""},629 {name: "missing tag", input: "alpine", wantRepo: "alpine", wantTag: ""},
628 {name: "trailing colon", input: "alpine:", wantRepo: "alpine:", wantTag: ""},630 {name: "trailing colon", input: "alpine:", wantRepo: "alpine:", wantTag: ""},
629 }631 }

Keyboard shortcuts

Single-key shortcuts are on. ctrl k and esc work whatever this says.

ctrl k :
go to a section, branch, tag, file or repository
?
this list
j k
move the row cursor down / up
enter
open the row under the cursor; on Files, a directory opens or closes in place
↑ ↓ ← → home end
in the file tree (focus on a row): previous / next row, close / open a directory or go to its parent / first entry, first / last row. They never open a file
l h
on Files: open a directory or a file / close a directory or go up to its parent, then to the parent page. Elsewhere: into the side panel (on a merge request, its files) / back to the content; there j k move between its controls
g g G
first / last row
/
filter the list; on Files, find a file anywhere in the repository (esc clears, enter opens the best match)
b
switch branch or tag
g s g f g c g b g m g i g r g a
tabs: summary, files, commits, branches & tags, merge requests, issues, releases, actions (when available)
g h
home
w
wide mode: use the whole width of the screen, or not (remembered)
y
copy a permalink pinned to the commit
d u x
diff: split / unified / collapse or expand all
e E
diff: the whole file in view / every file, with the lines the hunks hide
n
merge request: next note in the diff
esc
close a dialog, leave a field

Branches 7

Tags 106

↑↓ moveenter openesc close