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 @@ -468,6 +468,15 @@ func GetImages(w http.ResponseWriter, r *http.Request) {
468
468
// docker adds sha256: in front of the ID
469
469
for _ , s := range summaries {
470
470
s .ID = "sha256:" + s .ID
471
+ // Ensure RepoTags and RepoDigests are empty arrays instead of null for Docker compatibility
472
+ // as per https://docs.docker.com/reference/api/engine/version-history/#v143-api-changes
473
+ // Relates to https://issues.redhat.com/browse/RUN-2699
474
+ if s .RepoTags == nil {
475
+ s .RepoTags = []string {}
476
+ }
477
+ if s .RepoDigests == nil {
478
+ s .RepoDigests = []string {}
479
+ }
471
480
}
472
481
}
473
482
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
+ .[1].RepoTags=[] \
452
+ .[1].RepoDigests=[] \
453
+ .[1].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