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
Prev Previous commit
Next Next commit
Fix panin in test
Signed-off-by: Pablo Chacin <pablochacin@gmail.com>
pablochacin committed Sep 21, 2023

Verified

This commit was signed with the committer’s verified signature.
scottopell Scott Opell
commit 2b0ed211de61f7ab2984fe868b6d491695baa913
8 changes: 4 additions & 4 deletions modules/k3s/k3s_image_test.go
Original file line number Diff line number Diff line change
@@ -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)
}
@@ -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")
}
})