Repro:
cd $GOPATH
mkdir MyTestGroup
cd MyTestGroup
operator-sdk new test --api-version MyTestGroup/v1alpha1 --kind MyTestKind
cd test/pkg/stub
echo "package stub_test" > handler_test.go
go test
output like:
panic: lookup kubernetes.default.svc: no such host
goroutine 1 [running]:
MyTestGroup/test/vendor/github.com/operator-framework/operator-sdk/pkg/k8sclient.mustNewKubeClientAndConfig(0x1012d68, 0x10, 0x1b69220)
/Users/pivotal/go/src/MyTestGroup/test/vendor/github.com/operator-framework/operator-sdk/pkg/k8sclient/client.go:102 +0xc2
MyTestGroup/test/vendor/github.com/operator-framework/operator-sdk/pkg/k8sclient.init.0()
/Users/pivotal/go/src/MyTestGroup/test/vendor/github.com/operator-framework/operator-sdk/pkg/k8sclient/client.go:43 +0x34
exit status 2
FAIL MyTestGroup/test/pkg/stub 0.268s
This appears to be a result of global vars and init() causing an initialization of the k8sclient after the test system is run, and the test (an empty file) passes.
In other words, no test framework can work with the current implementation.
Repro:
output like:
This appears to be a result of global vars and init() causing an initialization of the k8sclient after the test system is run, and the test (an empty file) passes.
In other words, no test framework can work with the current implementation.