File tree Expand file tree Collapse file tree 2 files changed +24
-0
lines changed Expand file tree Collapse file tree 2 files changed +24
-0
lines changed Original file line number Diff line number Diff line change @@ -496,6 +496,15 @@ func GetImages(w http.ResponseWriter, r *http.Request) {
496
496
// docker adds sha256: in front of the ID
497
497
for _ , s := range summaries {
498
498
s .ID = "sha256:" + s .ID
499
+ // Ensure RepoTags and RepoDigests are empty arrays instead of null for Docker compatibility
500
+ // as per https://docs.docker.com/reference/api/engine/version-history/#v143-api-changes
501
+ // Relates to https://issues.redhat.com/browse/RUN-2699
502
+ if s .RepoTags == nil {
503
+ s .RepoTags = []string {}
504
+ }
505
+ if s .RepoDigests == nil {
506
+ s .RepoDigests = []string {}
507
+ }
499
508
}
500
509
}
501
510
utils .WriteResponse (w , http .StatusOK , summaries )
Original file line number Diff line number Diff line change @@ -440,4 +440,19 @@ t GET "libpod/events?stream=false&since=$START" 200 \
440
440
.Actor.Attributes.name=" localhost:5000/idonotexist" \
441
441
.Actor.Attributes.error~" .*connection refused"
442
442
443
+ # test empty RepoTags and RepoDigests is an empty array
444
+ IIDFILE=$( mktemp)
445
+ podman image build --iidfile $IIDFILE -<< EOF
446
+ FROM $IMAGE
447
+ RUN :
448
+ EOF
449
+
450
+ t GET images/json 200 \
451
+ .[2].RepoTags=[] \
452
+ .[2].RepoDigests=[] \
453
+ .[2].Id=$( < $IIDFILE )
454
+
455
+ podman rmi -f $( < $IIDFILE )
456
+ rm -f $IIDFILE
457
+
443
458
# vim: filetype=sh
You can’t perform that action at this time.
0 commit comments