Skip to content
This repository was archived by the owner on Jun 3, 2025. It is now read-only.

Commit 53fe819

Browse files
author
chhsia0
committed
Avoid comparing uncompressed and compressed images in the unit test.
1 parent 11f3b79 commit 53fe819

1 file changed

Lines changed: 14 additions & 4 deletions

File tree

pkg/executor/push_test.go

Lines changed: 14 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -91,6 +91,11 @@ func Test_OCILayoutPath(t *testing.T) {
9191
t.Fatalf("could not get image digest: %s", err)
9292
}
9393

94+
want, err := image.Manifest()
95+
if err != nil {
96+
t.Fatalf("could not get image manifest: %s", err)
97+
}
98+
9499
opts := config.KanikoOptions{
95100
NoPush: true,
96101
OCILayoutPath: tmpDir,
@@ -100,12 +105,17 @@ func Test_OCILayoutPath(t *testing.T) {
100105
t.Fatalf("could not push image: %s", err)
101106
}
102107

103-
index, err := layout.ImageIndexFromPath(tmpDir)
108+
layouIndex, err := layout.ImageIndexFromPath(tmpDir)
104109
if err != nil {
105110
t.Fatalf("could not get index from layout: %s", err)
106111
}
107-
testutil.CheckError(t, false, validate.Index(index))
112+
testutil.CheckError(t, false, validate.Index(layoutIndex))
113+
114+
layoutImage, err := layoutIndex.Image(digest)
115+
if err != nil {
116+
t.Fatalf("could not get image from layout: %s", err)
117+
}
108118

109-
got, err := index.Image(digest)
110-
testutil.CheckErrorAndDeepEqual(t, false, err, image, got)
119+
got, err := layoutImage.Manifest()
120+
testutil.CheckErrorAndDeepEqual(t, false, err, want, got)
111121
}

0 commit comments

Comments
 (0)