Documentation
¶
Index ¶
- type TearDownFunc
- type TestServer
- func StartTestServer(t *testing.T, ctx context.Context, customFlags []string) (result TestServer, err error)
- func StartTestServerOrDie(t *testing.T, ctx context.Context, flags []string) *TestServer
- func StartTestServerWithOptions(t *testing.T, ctx context.Context, customFlags []string, ...) (result TestServer, err error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type TearDownFunc ¶
type TearDownFunc func()
TearDownFunc is to be called to tear down a test server.
type TestServer ¶
type TestServer struct {
LoopbackClientConfig *restclient.Config // Rest client config using the magic token
Options *options.CloudControllerManagerOptions
Config *config.CompletedConfig
TearDownFn TearDownFunc // TearDown function
TmpDir string // Temp Dir used, by the apiserver
}
TestServer return values supplied by kube-test-ApiServer
func StartTestServer ¶
func StartTestServer(t *testing.T, ctx context.Context, customFlags []string) (result TestServer, err error)
StartTestServer starts a cloud-controller-manager. A rest client config and a tear-down func, and location of the tmpdir are returned.
Note: we return a tear-down func instead of a stop channel because the later will leak temporary files that because Golang testing's call to os.Exit will not give a stop channel go routine enough time to remove temporary files.
func StartTestServerOrDie ¶
StartTestServerOrDie calls StartTestServer panic if it does not succeed.
func StartTestServerWithOptions ¶ added in v0.33.0
func StartTestServerWithOptions(t *testing.T, ctx context.Context, customFlags []string, constructors map[string]app.ControllerInitFuncConstructor, aliases map[string]string) (result TestServer, err error)
StartTestServerWithOptions starts a cloud-controller-manager with extra controller loop initializer constructors and controller loop aliaes. Within the returned TestServer, a rest client config, a tear-down func, and location of the tmpdir are returned; or an error if one occurred.