terratest icon indicating copy to clipboard operation
terratest copied to clipboard

Is kubectl binary required when testing from Golang container ?

Open Constantin07 opened this issue 2 years ago • 2 comments

This is more an question to understand existing approach(es) as I couldn't find explicit answer documented.

I'm trying to run the tests in Golang container but when executing the KubectlApply it complains about missing kubectl.

Is there a way to deploy test K8s infra without the need of kubectl (using k8s client) ?

I'm not building a dedicated docker image with copied tests inside, just running the Golang container and mounting current folder with test(s).

PS: I would like to avoid creating a custom Golang image with just kubectl inside.

Constantin07 avatar Jun 28 '23 18:06 Constantin07

Hi, kubectl is required to be installed in the environment

References: https://github.com/gruntwork-io/terratest/blob/master/modules/k8s/kubectl.go#L40

denis256 avatar Jun 29 '23 19:06 denis256

Thanks @denis256 for confirmation.

Constantin07 avatar Jun 29 '23 20:06 Constantin07