Illustrate whitelist problem with test
@@ -235,11 +235,13 @@ func TestImageInfoCreatedAtZero(t *testing.T) {
func TestImage_OrderByCreationDate(t *testing.T) {
time0 := testTime.Add(time.Second)
time2 := testTime.Add(-time.Second)
+ ignoredTime := testTime.Add(+time.Minute)
+ ignoredTime2 := testTime.Add(+time.Hour)
imA := mustMakeInfo("my/Image:2", testTime)
- imB := mustMakeInfo("my/Image:0", time0)
- imC := mustMakeInfo("my/Image:3", time2)
+ imB := mustMakeInfo("my/Image:0", time0).setLabels(Labels{Created: ignoredTime2}) // label time should be ignored
+ imC := mustMakeInfo("my/Image:3", time2).setLabels(Labels{BuildDate: ignoredTime}) // label time should be ignored
imD := mustMakeInfo("my/Image:4", time.Time{}) // test nil
- imE := mustMakeInfo("my/Image:1", testTime) // test equal
+ imE := mustMakeInfo("my/Image:1", testTime).setLabels(Labels{Created: testTime}) // test equal
imF := mustMakeInfo("my/Image:5", time.Time{}) // test nil equal
imgs := []Info{imA, imB, imC, imD, imE, imF}
Sort(imgs, NewerByCreated)
