kubernetes: k8s.io/kubernetes/cmd/cloud-controller-manager/app/testing Index | Files

package testing

import "k8s.io/kubernetes/cmd/cloud-controller-manager/app/testing"


Package Files


type Logger Uses

type Logger interface {
    Errorf(format string, args ...interface{})
    Fatalf(format string, args ...interface{})
    Logf(format string, args ...interface{})

Logger allows t.Testing and b.Testing to be passed to StartTestServer and StartTestServerOrDie

type TearDownFunc Uses

type TearDownFunc func()

TearDownFunc is to be called to tear down a test server.

type TestServer Uses

type TestServer struct {
    LoopbackClientConfig *restclient.Config // Rest client config using the magic token
    Options              *options.CloudControllerManagerOptions
    Config               *cloudcontrollerconfig.Config
    TearDownFn           TearDownFunc // TearDown function
    TmpDir               string       // Temp Dir used, by the apiserver

TestServer return values supplied by kube-test-ApiServer

func StartTestServer Uses

func StartTestServer(t Logger, 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 Uses

func StartTestServerOrDie(t Logger, flags []string) *TestServer

StartTestServerOrDie calls StartTestServer t.Fatal if it does not succeed.

Package testing imports 13 packages (graph). Updated 2020-04-04. Refresh now. Tools for package owners.