testcontainers / testcontainers/testcontainers-java

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

Open
#7,086 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

type/bug
Dominant language
Java
Stars
8.7k
Forks
1.9k
Avg merge
2d 17h
Merged PRs (30d)
9

Description

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

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start at DockerClientProviderStrategy.java:231 and reproduce the failure in a Jenkins environment running on Kubernetes 1.24 with containerd and no Docker daemon. Investigate the available container runtime connection described in the issue, then define and verify what support would let the Java tests create containers without Docker; the issue names no test file to run.

Written by the indexing model from the issue text.

Assessment

Tech stack
docker, java, kubernetes, spring
Domain
devops, infrastructure, testing
Issue type
Bug
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
20/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.