testcontainers / testcontainers-java

Testcontainers is a Java library that supports JUnit tests, providing lightweight, throwaway instances of common databases, Selenium web browsers, or anything else that can run in a Docker container.
https://testcontainers.org
MIT License
7.98k stars 1.64k forks source link

[Bug]: Cant run tests on K8s 1.24 without docker CR #7086

Open kahootali opened 1 year ago

kahootali commented 1 year ago

Module

Core

Testcontainers version

1.18.2

Using the latest Testcontainers version?

Yes

Host OS

Ubuntu

Host Arch

x86

Docker version

Not using docker daemon, using containerd as K8s has stopped supported Docker as Container Runtime in 1.22

What happened?

We are using Jenkins on K8s and build our Java spring applications, now when we updated our K8s cluster to 1.24, and from 1.24 AWS EKS has stopped providing Docker as the container runtime rather supporting CRI. The issue is the pipelines stopped working when we updated it, as testcontainers was trying to use docker to create containers. I have also tried mounting /run/containerd/containerd.sock

Relevant log output

MyTest > my test FAILED
    java.lang.IllegalStateException at DefaultCacheAwareContextLoaderDelegate.java:98
        Caused by: org.springframework.beans.factory.UnsatisfiedDependencyException at ConstructorResolver.java:800
            Caused by: org.springframework.beans.factory.BeanCreationException at ConstructorResolver.java:658
                Caused by: org.springframework.beans.BeanInstantiationException at SimpleInstantiationStrategy.java:185
                    Caused by: java.lang.IllegalStateException at DockerClientProviderStrategy.java:231

Additional Information

No response

Sandy7894 commented 8 months ago

I am also facing the same issue, any luck here ?