-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Closed
Description
It appears if I provide custom paths to envtest.Environment struct it ignores them. Minimal repro:
func TestNewEnvironment(t *testing.T) {
testEnv := &envtest.Environment{
ControlPlane: envtest.ControlPlane{
APIServer: &envtest.APIServer{
Path: "/Users/abalkan/workspace/my-project/bin/kubebuilder_1.30.3_darwin_amd64/kube-apiserver",
},
Etcd: &envtest.Etcd{
Path: "/Users/abalkan/workspace/my-project/bin/kubebuilder_1.30.3_darwin_amd64/etcd",
},
},
}
// Start the control plane
cfg, err := testEnv.Start()
if err != nil {
t.Fatalf("Failed to start control plane: %v", err)
}
}
Gives error:
Failed to start control plane: unable to start control plane itself: failed to start the controlplane. retried 5 times: fork/exec /usr/local/kubebuilder/bin/etcd: no such file or directory
so it's looking at the wrong path despite the provided path override.
Currently one has to do t.Setenv("TEST_ASSET_KUBE_APISERVER", "...") to make this work I think, which is a little less than ideal.
Metadata
Metadata
Assignees
Labels
No labels