Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: support for loading images in the K3s module #1622

Merged
merged 12 commits into from
Sep 21, 2023
8 changes: 4 additions & 4 deletions modules/k3s/k3s_image_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -60,14 +60,14 @@ func Test_LoadImages(t *testing.T) {
}

t.Run("Test load image not available", func(t *testing.T) {
err = k3sContainer.LoadImages(context.Background(), "nginx", "fake.registry/fake:non-existing")
err := k3sContainer.LoadImages(context.Background(), "fake.registry/fake:non-existing")
if err == nil {
t.Fatal("should had failed")
}
})

t.Run("Test load image in cluster", func(t *testing.T) {
err = k3sContainer.LoadImages(context.Background(), "nginx")
err := k3sContainer.LoadImages(context.Background(), "nginx")
if err != nil {
t.Fatal(err)
}
Expand Down Expand Up @@ -101,8 +101,8 @@ func Test_LoadImages(t *testing.T) {
if err != nil {
t.Fatal(err)
}

if pod.Status.ContainerStatuses[0].State.Waiting.Reason == "ErrImageNeverPull" {
waiting := pod.Status.ContainerStatuses[0].State.Waiting
if waiting != nil && waiting.Reason == "ErrImageNeverPull" {
mdelapenya marked this conversation as resolved.
Show resolved Hide resolved
t.Fatal("Image was not loaded")
}
})
Expand Down