{"modulePath":"github.com/dockerstack/kubernetes","version":"v0.20.1-0.20150627061651-1c0b765df6da","isLatest":true,"isStandardLibrary":false,"goos":"all","goarch":"all","docs":"# package framework\n\n## Constants\n\n```go\nconst (\n\t// Timeout used in benchmarks, to eg: scale an rc\n\tDefaultTimeout = 30 * time.Minute\n\n\t// Rc manifest used to create pods for benchmarks.\n\t// TODO: Convert this to a full path?\n\tTestRCManifest = \"benchmark-controller.json\"\n\n\t// Test Namspace, for pods and rcs.\n\tTestNS = \"test\"\n)\n```\n\n## Functions\n\n```go\nfunc DeleteAllEtcdKeys()\n```\nDeleteAllEtcdKeys deletes all keys from etcd. TODO: Instead of sprinkling calls to this throughout the code, adjust the prefix in etcdtest package; then just delete everything once at the end of the test run.\n\n```go\nfunc NewEtcdClient() *etcd.Client\n```\n\n```go\nfunc NewHelper() (tools.EtcdHelper, error)\n```\n\n```go\nfunc RCFromManifest(fileName string) *api.ReplicationController\n```\nRCFromManifest reads a .json file and returns the rc in it.\n\n```go\nfunc RequireEtcd()\n```\n\n```go\nfunc RunAMaster(t *testing.T) (*master.Master, *httptest.Server)\n```\nTODO: Merge this into startMasterOrDie.\n\n```go\nfunc RunParallel(task Task, numTasks, numWorkers int)\n```\nRunParallel spawns a goroutine per task in the given queue\n\n```go\nfunc ScaleRC(name, ns string, replicas int, restClient *client.Client) (*api.ReplicationController, error)\n```\nScaleRC scales the given rc to the given replicas.\n\n```go\nfunc StartPods(numPods int, host string, restClient *client.Client) error\n```\nStartPods check for numPods in TestNS. If they exist, it no-ops, otherwise it starts up a temp rc, scales it to match numPods, then deletes the rc leaving behind the pods.\n\n```go\nfunc StartRC(controller *api.ReplicationController, restClient *client.Client) (*api.ReplicationController, error)\n```\nStartRC creates given rc if it doesn't already exist, then updates it via kubectl's scaler.\n\n```go\nfunc StopRC(rc *api.ReplicationController, restClient *client.Client) error\n```\nStopRC stops the rc via kubectl's stop library\n\n```go\nfunc WithEtcdKey(f func(string))\n```\n\n## Types\n\n```go\ntype Config struct {\n\t// If nil, a default is used, partially filled configs will not get populated.\n\tMasterConfig            *master.Config\n\tStartReplicationManager bool\n\t// If true, all existing etcd keys are purged before starting master components\n\tDeleteEtcdKeys bool\n\t// Client throttling qps\n\tQPS float32\n\t// Client burst qps, also burst replicas allowed in rc manager\n\tBurst int\n}\n```\nConfig is a struct of configuration directives for NewMasterComponents.\n\n```go\ntype MasterComponents struct {\n\t// Raw http server in front of the master\n\tApiServer *httptest.Server\n\t// Kubernetes master, contains an embedded etcd helper\n\tKubeMaster *master.Master\n\t// Restclient used to talk to the kubernetes master\n\tRestClient *client.Client\n\t// Replication controller manager\n\tControllerManager *controller.ReplicationManager\n\n\t// Kubernetes etcd helper, has embedded etcd client\n\tEtcdHelper *tools.EtcdHelper\n\t// contains filtered or unexported fields\n}\n```\nMasterComponents is a control struct for all master components started via NewMasterComponents. TODO: Include all master components (scheduler, nodecontroller). TODO: Reconcile with integration.go, currently the master used there doesn't understand how to restart cleanly, which is required for each iteration of a benchmark. The integration tests also don't make it easy to isolate and turn off components at will.\n\n```go\nfunc NewMasterComponents(c *Config) *MasterComponents\n```\nNewMasterComponents creates, initializes and starts master components based on the given config.\n\n```go\nfunc (m *MasterComponents) Stop(apiServer, rcManager bool)\n```\n\n```go\ntype Task func(id int) error\n```\nTask is a function passed to worker goroutines by RunParallel. The function needs to implement its own thread safety.\n\n","path":"github.com/dockerstack/kubernetes/test/integration/framework","name":"framework","synopsis":"","isRedistributable":true}
