@@ -18,7 +18,6 @@ package image
18
18
19
19
import (
20
20
"encoding/json"
21
- "runtime"
22
21
"strings"
23
22
"testing"
24
23
@@ -71,16 +70,12 @@ func TestImageInspectSimpleCases(t *testing.T) {
71
70
func TestImageInspectDifferentValidReferencesForTheSameImage (t * testing.T ) {
72
71
nerdtest .Setup ()
73
72
74
- platform := runtime .GOOS + "/" + runtime .GOARCH
75
-
76
73
tags := []string {
77
74
"" ,
78
75
":latest" ,
79
- ":stable" ,
80
76
}
81
77
names := []string {
82
78
"busybox" ,
83
- "library/busybox" ,
84
79
"docker.io/library/busybox" ,
85
80
"registry-1.docker.io/library/busybox" ,
86
81
}
@@ -94,11 +89,9 @@ func TestImageInspectDifferentValidReferencesForTheSameImage(t *testing.T) {
94
89
nerdtest .Private ,
95
90
),
96
91
Setup : func (data test.Data , helpers test.Helpers ) {
97
- helpers .Ensure ("pull" , "alpine" , "--platform" , platform )
98
- helpers .Ensure ("pull" , "busybox" , "--platform" , platform )
99
- helpers .Ensure ("pull" , "busybox:stable" , "--platform" , platform )
100
- helpers .Ensure ("pull" , "registry-1.docker.io/library/busybox" , "--platform" , platform )
101
- helpers .Ensure ("pull" , "registry-1.docker.io/library/busybox:stable" , "--platform" , platform )
92
+ helpers .Ensure ("pull" , "alpine" )
93
+ helpers .Ensure ("pull" , "busybox" )
94
+ helpers .Ensure ("pull" , "registry-1.docker.io/library/busybox" )
102
95
},
103
96
SubTests : []* test.Case {
104
97
{
@@ -150,9 +143,11 @@ func TestImageInspectDifferentValidReferencesForTheSameImage(t *testing.T) {
150
143
151
144
// Demonstrate image name precedence over digest lookup
152
145
// Using the shortened sha should no longer get busybox, but rather the newly tagged Alpine
146
+ // FIXME: this is triggering https://github.com/containerd/nerdctl/issues/3016
147
+ // We cannot get rid of that image now, which does break local testing
153
148
helpers .Ensure ("tag" , "alpine" , sha [0 :8 ])
154
149
it := nerdtest .InspectImage (helpers , sha [0 :8 ])
155
- assert .Equal (t , it .ID , alpine .ID , alpine . ID + " vs " + it . ID )
150
+ assert .Equal (t , it .ID , alpine .ID )
156
151
},
157
152
}
158
153
},
@@ -202,18 +197,17 @@ func TestImageInspectDifferentValidReferencesForTheSameImage(t *testing.T) {
202
197
},
203
198
{
204
199
Description : "retrieving multiple entries at once" ,
205
- Command : test .RunCommand ("image" , "inspect" , "busybox" , "busybox" , "busybox:stable" ),
200
+ Command : test .RunCommand ("image" , "inspect" , "busybox" , "busybox" ),
206
201
Expected : func (data test.Data , helpers test.Helpers ) * test.Expected {
207
202
return & test.Expected {
208
203
Output : func (stdout string , info string , t * testing.T ) {
209
204
var dc []dockercompat.Image
210
205
err := json .Unmarshal ([]byte (stdout ), & dc )
211
206
assert .NilError (t , err , "Unable to unmarshal output\n " + info )
212
- assert .Equal (t , 3 , len (dc ), "Unexpectedly did not get 3 results\n " + info )
207
+ assert .Equal (t , 2 , len (dc ), "Unexpectedly did not get 2 results\n " + info )
213
208
reference := nerdtest .InspectImage (helpers , "busybox" )
214
209
assert .Equal (t , dc [0 ].ID , reference .ID )
215
210
assert .Equal (t , dc [1 ].ID , reference .ID )
216
- assert .Equal (t , dc [2 ].ID , reference .ID )
217
211
},
218
212
}
219
213
},
0 commit comments