EnvTest returns an unstarted Environment with crds. It calls t.Skip when the "KUBEBUILDER_ASSETS" and "USE_EXISTING_CLUSTER" environment variables are unset.
(t TestingT, crds envtest.CRDInstallOptions)
| 40 | // the "KUBEBUILDER_ASSETS" and "USE_EXISTING_CLUSTER" environment variables |
| 41 | // are unset. |
| 42 | func EnvTest(t TestingT, crds envtest.CRDInstallOptions) *envtest.Environment { |
| 43 | t.Helper() |
| 44 | |
| 45 | if !envtestVarsSet { |
| 46 | t.SkipNow() |
| 47 | } |
| 48 | |
| 49 | return &envtest.Environment{ |
| 50 | CRDInstallOptions: crds, |
| 51 | Scheme: crds.Scheme, |
| 52 | } |
| 53 | } |
| 54 | |
| 55 | var kubernetes struct { |
| 56 | sync.Mutex |
no test coverage detected