container-structure-test icon indicating copy to clipboard operation
container-structure-test copied to clipboard

Kubernetes driver for command tests

Open coopernetes opened this issue 3 years ago • 1 comments

Related to #270 , it would be extremely convenient to be able to use a Kubernetes native driver to run both image content tests (the currently supported test types using --driver tar) as well as command tests that could run as pods against an image-under-test.

This is an oversimplification but at a HL, a new driver of type kubernetes is created which can use an existing user's KUBECONFIG context and executes kubectl run cst-pod-randomid --image=image-under-test --command -- <cmd> <args...> for each command test indicated. Instead of inspecting the Docker/containerd socket for completion status, verify pod status, exit code, etc.

There are some obvious edge cases such as running pods in a secure environment (gVisor, Openshift, clusters with PodSecurityContext, etc) that may prevent this outright. But I'd still like to entertain the idea for those in shared environments that may not have access to a Docker/containerd host directly.

coopernetes avatar Sep 25 '22 21:09 coopernetes

I would also be interested in using this testing framework on Kubernetes clusters especially OpenShift where docker daemons are not present.

dominik0711 avatar Jun 12 '24 12:06 dominik0711