Skip to content

Commit

Permalink
trying to fix unit test failure in Windows LCOW
Browse files Browse the repository at this point in the history
Signed-off-by: Juan Bustamante <[email protected]>
  • Loading branch information
jjbustamante committed Nov 9, 2023
1 parent 8f34bf0 commit d00f1a9
Showing 1 changed file with 2 additions and 6 deletions.
8 changes: 2 additions & 6 deletions pkg/image/fetcher_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -218,18 +218,14 @@ func testFetcher(t *testing.T, when spec.G, it spec.S) {
})

when("remote platform does not match", func() {
os := "linux"
it.Before(func() {
if runtime.GOOS == "windows" {
os = "windows"
}
img, err := remote.NewImage(repoName, authn.DefaultKeychain, remote.WithDefaultPlatform(imgutil.Platform{OS: os, Architecture: ""}))
img, err := remote.NewImage(repoName, authn.DefaultKeychain, remote.WithDefaultPlatform(imgutil.Platform{OS: runtime.GOOS, Architecture: ""}))
h.AssertNil(t, err)
h.AssertNil(t, img.Save())
})

it("retry without setting platform", func() {
_, err := imageFetcher.Fetch(context.TODO(), repoName, image.FetchOptions{Daemon: true, PullPolicy: image.PullAlways, Platform: fmt.Sprintf("%s/amd64", os)})
_, err := imageFetcher.Fetch(context.TODO(), repoName, image.FetchOptions{Daemon: true, PullPolicy: image.PullAlways, Platform: fmt.Sprintf("%s/amd64", runtime.GOOS)})
h.AssertNil(t, err)
})
})
Expand Down

0 comments on commit d00f1a9

Please sign in to comment.