{"modulePath":"github.com/stackpointcloud/kubernetes","version":"v1.3.4","isLatest":true,"isStandardLibrary":false,"goos":"all","goarch":"all","docs":"# package framework\n\nThis is a utility for prometheus pushing functionality.\n\n## Constants\n\n```go\nconst (\n\t// How long to wait for the pod to be listable\n\tPodListTimeout = time.Minute\n\t// Initial pod start can be delayed O(minutes) by slow docker pulls\n\t// TODO: Make this 30 seconds once #4566 is resolved.\n\tPodStartTimeout = 5 * time.Minute\n\n\t// If there are any orphaned namespaces to clean up, this test is running\n\t// on a long lived cluster. A long wait here is preferably to spurious test\n\t// failures caused by leaked resources from a previous test run.\n\tNamespaceCleanupTimeout = 15 * time.Minute\n\n\t// How long to wait for a service endpoint to be resolvable.\n\tServiceStartTimeout = 1 * time.Minute\n\n\t// How often to Poll pods, nodes and claims.\n\tPoll = 2 * time.Second\n\n\t// service accounts are provisioned after namespace creation\n\t// a service account is required to support pod creation in a namespace as part of admission control\n\tServiceAccountProvisionTimeout = 2 * time.Minute\n\n\t// How long to try single API calls (like 'get' or 'list'). Used to prevent\n\t// transient failures from failing tests.\n\t// TODO: client should not apply this timeout to Watch calls. Increased from 30s until that is fixed.\n\tSingleCallTimeout = 5 * time.Minute\n\n\t// How long nodes have to be \"ready\" when a test begins. They should already\n\t// be \"ready\" before the test starts, so this is small.\n\tNodeReadyInitialTimeout = 20 * time.Second\n\n\t// How long pods have to be \"ready\" when a test begins.\n\tPodReadyBeforeTimeout = 5 * time.Minute\n\n\tServiceRespondingTimeout = 2 * time.Minute\n\tEndpointRegisterTimeout  = time.Minute\n\n\t// How long claims have to become dynamically provisioned\n\tClaimProvisionTimeout = 5 * time.Minute\n\n\t// How long each node is given during a process that restarts all nodes\n\t// before the test is considered failed. (Note that the total time to\n\t// restart all nodes will be this number times the number of nodes.)\n\tRestartPerNodeTimeout = 5 * time.Minute\n\n\t// How often to Poll the statues of a restart.\n\tRestartPoll = 20 * time.Second\n\n\t// How long a node is allowed to become \"Ready\" after it is restarted before\n\t// the test is considered failed.\n\tRestartNodeReadyAgainTimeout = 5 * time.Minute\n\n\t// How long a pod is allowed to become \"running\" and \"ready\" after a node\n\t// restart before test is considered failed.\n\tRestartPodReadyAgainTimeout = 5 * time.Minute\n)\n```\n\n```go\nconst (\n\t// NodeStartupThreshold is a rough estimate of the time allocated for a pod to start on a node.\n\tNodeStartupThreshold = 4 * time.Second\n)\n```\n\n## Variables\n\n```go\nvar (\n\t// Label allocated to the image puller static pod that runs on each node\n\t// before e2es.\n\tImagePullerLabels = map[string]string{\"name\": \"e2e-image-puller\"}\n)\n```\n\n```go\nvar InterestingApiServerMetrics = []string{\n\t\"apiserver_request_count\",\n\t\"apiserver_request_latencies_summary\",\n\t\"etcd_helper_cache_entry_count\",\n\t\"etcd_helper_cache_hit_count\",\n\t\"etcd_helper_cache_miss_count\",\n\t\"etcd_request_cache_add_latencies_summary\",\n\t\"etcd_request_cache_get_latencies_summary\",\n\t\"etcd_request_latencies_summary\",\n}\n```\n\n```go\nvar InterestingKubeletMetrics = []string{\n\t\"kubelet_container_manager_latency_microseconds\",\n\t\"kubelet_docker_errors\",\n\t\"kubelet_docker_operations_latency_microseconds\",\n\t\"kubelet_generate_pod_status_latency_microseconds\",\n\t\"kubelet_pod_start_latency_microseconds\",\n\t\"kubelet_pod_worker_latency_microseconds\",\n\t\"kubelet_pod_worker_start_latency_microseconds\",\n\t\"kubelet_sync_pods_latency_microseconds\",\n}\n```\n\n```go\nvar MasterUpgrade = func(v string) error {\n\tswitch TestContext.Provider {\n\tcase \"gce\":\n\t\treturn masterUpgradeGCE(v)\n\tcase \"gke\":\n\t\treturn masterUpgradeGKE(v)\n\tdefault:\n\t\treturn fmt.Errorf(\"MasterUpgrade() is not implemented for provider %s\", TestContext.Provider)\n\t}\n}\n```\nThe following upgrade functions are passed into the framework below and used to do the actual upgrades.\n\n```go\nvar NodeUpgrade = func(f *Framework, v string) error {\n\t// Perform the upgrade.\n\tvar err error\n\tswitch TestContext.Provider {\n\tcase \"gce\":\n\t\terr = nodeUpgradeGCE(v)\n\tcase \"gke\":\n\t\terr = nodeUpgradeGKE(v)\n\tdefault:\n\t\terr = fmt.Errorf(\"NodeUpgrade() is not implemented for provider %s\", TestContext.Provider)\n\t}\n\tif err != nil {\n\t\treturn err\n\t}\n\n\tLogf(\"Waiting up to %v for all nodes to be ready after the upgrade\", RestartNodeReadyAgainTimeout)\n\tif _, err := CheckNodesReady(f.Client, RestartNodeReadyAgainTimeout, TestContext.CloudConfig.NumNodes); err != nil {\n\t\treturn err\n\t}\n\treturn nil\n}\n```\n\n```go\nvar ProvidersWithSSH = []string{\"gce\", \"gke\", \"aws\"}\n```\nProvidersWithSSH are those providers where each node is accessible with SSH\n\n```go\nvar RunId = util.NewUUID()\n```\nunique identifier of the e2e run\n\n```go\nvar SubResourcePodProxyVersion = version.MustParse(\"v1.1.0\")\n```\nSubResource proxy should have been functional in v1.0.0, but SubResource proxy via tunneling is known to be broken in v1.0.  See [https://github.com/kubernetes/kubernetes/pull/15224#issuecomment-146769463](https://github.com/kubernetes/kubernetes/pull/15224#issuecomment-146769463)\n\nTODO(ihmccreery): remove once we don't care about v1.0 anymore, (tentatively in v1.3).\n\n## Functions\n\n```go\nfunc AllNodesReady(c *client.Client, timeout time.Duration) error\n```\nchecks whether all registered nodes are ready\n\n```go\nfunc ApiCallToPerfData(apicalls APIResponsiveness) *perftype.PerfData\n```\nApiCallToPerfData transforms APIResponsiveness to PerfData.\n\n```go\nfunc AssertCleanup(ns string, selectors ...string)\n```\nAsserts that cleanup of a namespace wrt selectors occurred.\n\n```go\nfunc BadEvents(events []*api.Event) int\n```\nPrints the histogram of the events and returns the number of bad events.\n\n```go\nfunc BlockNetwork(from string, to string)\n```\nThe following helper functions can block/unblock network from source host to destination host by manipulating iptable rules. This function assumes it can ssh to the source host.\n\nCaution: Recommend to input IP instead of hostnames. Using hostnames will cause iptables to do a DNS lookup to resolve the name to an IP address, which will slow down the test and cause it to fail if DNS is absent or broken.\n\nSuggested usage pattern:\n\n\tfunc foo() {\n\t\t...\n\t\tdefer UnblockNetwork(from, to)\n\t\tBlockNetwork(from, to)\n\t\t...\n\t}\n\n```go\nfunc CPUUsageToPerfData(usagePerNode NodesCPUSummary) *perftype.PerfData\n```\nCPUUsageToPerfData transforms NodesCPUSummary to PerfData.\n\n```go\nfunc CheckConnectivityToHost(f *Framework, nodeName, podName, host string, timeout int) error\n```\nCheckConnectivityToHost launches a pod running wget on the specified node to test connectivity to the specified host.  An error will be returned if the host is not reachable from the pod.\n\n```go\nfunc CheckInvariants(events []watch.Event, fns ...InvariantFunc) error\n```\n\n```go\nfunc CheckNewRSAnnotations(c clientset.Interface, ns, deploymentName string, expectedAnnotations map[string]string) error\n```\nCheckNewRSAnnotations check if the new RS's annotation is as expected\n\n```go\nfunc CheckNodesReady(c *client.Client, nt time.Duration, expect int) ([]string, error)\n```\nCheckNodesReady waits up to nt for expect nodes accessed by c to be ready, returning an error if this doesn't happen in time. It returns the names of nodes it finds.\n\n```go\nfunc CheckPodHashLabel(pods *api.PodList) error\n```\n\n```go\nfunc CheckPodsCondition(c *client.Client, ns string, podNames []string, timeout time.Duration, condition podCondition, desc string) bool\n```\nCheckPodsCondition returns whether all pods whose names are listed in podNames in namespace ns are in the condition, using c and waiting at most timeout.\n\n```go\nfunc CheckPodsRunningReady(c *client.Client, ns string, podNames []string, timeout time.Duration) bool\n```\nCheckPodsRunningReady returns whether all pods whose names are listed in podNames in namespace ns are running and ready, using c and waiting at most timeout.\n\n```go\nfunc CheckPodsRunningReadyOrSucceeded(c *client.Client, ns string, podNames []string, timeout time.Duration) bool\n```\nCheckPodsRunningReadyOrSucceeded returns whether all pods whose names are listed in podNames in namespace ns are running and ready, or succeeded; use c and waiting at most timeout.\n\n```go\nfunc CheckRSHashLabel(rs *extensions.ReplicaSet) error\n```\n\n```go\nfunc CheckTestingNSDeletedExcept(c *client.Client, skip string) error\n```\nCheckTestingNSDeletedExcept checks whether all e2e based existing namespaces are in the Terminating state and waits until they are finally deleted. It ignores namespace skip.\n\n```go\nfunc Cleanup(filePath, ns string, selectors ...string)\n```\nStops everything from filePath from namespace ns and checks if everything matching selectors from the given namespace is correctly stopped.\n\n```go\nfunc ContainerInitInvariant(older, newer runtime.Object) error\n```\n\n```go\nfunc CoreDump(dir string)\n```\nCoreDump SSHs to the master and all nodes and dumps their logs into dir. It shells out to cluster/log-dump.sh to accomplish this.\n\n```go\nfunc CreateTestingNS(baseName string, c *client.Client, labels map[string]string) (*api.Namespace, error)\n```\nCreateTestingNS should be used by every test, note that we append a common prefix to the provided test name. Please see NewFramework instead of using this directly.\n\n```go\nfunc DeleteNamespaces(c *client.Client, deleteFilter, skipFilter []string) ([]string, error)\n```\nDeleteNamespaces deletes all namespaces that match the given delete and skip filters. Filter is by simple strings.Contains; first skip filter, then delete filter. Returns the list of deleted namespaces or an error.\n\n```go\nfunc DeleteRC(c *client.Client, ns, name string) error\n```\nDelete a Replication Controller and all pods it spawned\n\n```go\nfunc DeleteReplicaSet(c *client.Client, ns, name string) error\n```\nDelete a ReplicaSet and all pods it spawned\n\n```go\nfunc DumpAllNamespaceInfo(c *client.Client, namespace string)\n```\n\n```go\nfunc DumpNodeDebugInfo(c *client.Client, nodeNames []string)\n```\n\n```go\nfunc EnsureLoadBalancerResourcesDeleted(ip, portRange string) error\n```\nEnsureLoadBalancerResourcesDeleted ensures that cloud load balancer resources that were created are actually cleaned up.  Currently only implemented for GCE/GKE.\n\n```go\nfunc ExpectNoError(err error, explain ...interface{})\n```\n\n```go\nfunc FailedContainers(pod *api.Pod) map[string]ContainerFailures\n```\nFailedContainers inspects all containers in a pod and returns failure information for containers that have failed or been restarted. A map is returned where the key is the containerID and the value is a struct containing the restart and failure information\n\n```go\nfunc Failf(format string, args ...interface{})\n```\n\n```go\nfunc FilterNodes(nodeList *api.NodeList, fn func(node api.Node) bool)\n```\nFilters nodes in NodeList in place, removing nodes that do not satisfy the given condition TODO: consider merging with pkg/client/cache.NodeLister\n\n```go\nfunc FormatRuntimeOperationErrorRate(nodesResult map[string]NodeRuntimeOperationErrorRate) string\n```\nFormatRuntimeOperationErrorRate formats the runtime operation error rate to string.\n\n```go\nfunc GetHostExternalAddress(client *client.Client, p *api.Pod) (externalAddress string, err error)\n```\nGetHostExternalAddress gets the node for a pod and returns the first External address. Returns an error if the node the pod is on doesn't have an External address.\n\n```go\nfunc GetKubeletHeapStats(c *client.Client, nodeName string) (string, error)\n```\n\n```go\nfunc GetKubeletPods(c *client.Client, node string) (*api.PodList, error)\n```\nGetKubeletPods retrieves the list of pods on the kubelet\n\n```go\nfunc GetKubeletRunningPods(c *client.Client, node string) (*api.PodList, error)\n```\nGetKubeletRunningPods retrieves the list of running pods on the kubelet. The pods includes necessary information (e.g., UID, name, namespace for pods/containers), but do not contain the full spec.\n\n```go\nfunc GetMasterHost() string\n```\n\n```go\nfunc GetNodePortURL(client *client.Client, ns, name string, svcPort int) (string, error)\n```\nGetNodePortURL returns the url to a nodeport Service.\n\n```go\nfunc GetPauseImageName(c *client.Client) string\n```\nGetPauseImageName fetches the pause image name for the same architecture as the apiserver.\n\n```go\nfunc GetPauseImageNameForHostArch() string\n```\nGetPauseImageNameForHostArch fetches the pause image name for the same architecture the test is running on.\n\n```go\nfunc GetPodLogs(c *client.Client, namespace, podName, containerName string) (string, error)\n```\n\n```go\nfunc GetPodsInNamespace(c *client.Client, ns string, ignoreLabels map[string]string) ([]*api.Pod, error)\n```\n\n```go\nfunc GetReadySchedulableNodesOrDie(c *client.Client) (nodes *api.NodeList)\n```\nGetReadySchedulableNodesOrDie addresses the common use case of getting nodes you can do work on. 1) Needs to be schedulable. 2) Needs to be ready. If EITHER 1 or 2 is not true, most tests will want to ignore the node entirely.\n\n```go\nfunc GetServerArchitecture(c *client.Client) string\n```\nGetServerArchitecture fetches the architecture of the cluster's apiserver.\n\n```go\nfunc GetServicesProxyRequest(c *client.Client, request *restclient.Request) (*restclient.Request, error)\n```\n\n```go\nfunc GetSigner(provider string) (ssh.Signer, error)\n```\nGetSigner returns an ssh.Signer for the provider (\"gce\", etc.) that can be used to SSH to their nodes.\n\n```go\nfunc GetValidDNSSubdomainName(name string) (string, error)\n```\nGetValidDNSSubdomainName massages the given name to be a valid dns subdomain name. Most resources (such as secrets, clusters) require the names to be valid dns subdomain. This is a generic function (not specific to federation). Should be moved to a more generic location if others want to use it.\n\n```go\nfunc HighLatencyRequests(c *client.Client) (int, error)\n```\nPrints top five summary metrics for request types with latency and returns number of such request types above threshold.\n\n```go\nfunc IsNodeConditionSetAsExpected(node *api.Node, conditionType api.NodeConditionType, wantTrue bool) bool\n```\n\n```go\nfunc IsNodeConditionSetAsExpectedSilent(node *api.Node, conditionType api.NodeConditionType, wantTrue bool) bool\n```\n\n```go\nfunc IsNodeConditionUnset(node *api.Node, conditionType api.NodeConditionType) bool\n```\n\n```go\nfunc IssueSSHCommand(cmd, provider string, node *api.Node) error\n```\n\n```go\nfunc KubeDescribe(text string, body func()) bool\n```\nWrapper function for ginkgo describe.  Adds namespacing. TODO: Support type safe tagging as well [https://github.com/kubernetes/kubernetes/pull/22401](https://github.com/kubernetes/kubernetes/pull/22401).\n\n```go\nfunc KubectlCmd(args ...string) *exec.Cmd\n```\nKubectlCmd runs the kubectl executable through the wrapper script.\n\n```go\nfunc KubectlVersion() (semver.Version, error)\n```\nKubectlVersion gets the version of kubectl that's currently being used (see --kubectl-path in e2e.go to use an alternate kubectl).\n\n```go\nfunc KubectlVersionGTE(v semver.Version) (bool, error)\n```\nKubectlVersionGTE returns true if the kubectl version is greater than or equal to v.\n\n```go\nfunc LaunchHostExecPod(client *client.Client, ns, name string) *api.Pod\n```\nLaunchHostExecPod launches a hostexec pod in the given namespace and waits until it's Running\n\n```go\nfunc LaunchWebserverPod(f *Framework, podName, nodeName string) (ip string)\n```\nLaunchWebserverPod launches a pod serving http on port 8080 to act as the target for networking connectivity checks.  The ip address of the created pod will be returned if the pod is launched successfully.\n\n```go\nfunc LoadClient() (*client.Client, error)\n```\n\n```go\nfunc LoadConfig() (*restclient.Config, error)\n```\n\n```go\nfunc LoadFederatedConfig() (*restclient.Config, error)\n```\n\n```go\nfunc LoadFederationClient() (*unversionedfederation.FederationClient, error)\n```\n\n```go\nfunc LoadFederationClientset() (*federation_internalclientset.Clientset, error)\n```\n\n```go\nfunc LoadFederationClientset_1_3() (*federation_release_1_3.Clientset, error)\n```\n\n```go\nfunc LogContainersInPodsWithLabels(c *client.Client, ns string, match map[string]string, containerSubstr string)\n```\n\n```go\nfunc LogFailedContainers(c *client.Client, ns string)\n```\n\n```go\nfunc LogPodsWithLabels(c *client.Client, ns string, match map[string]string)\n```\n\n```go\nfunc LogSSHResult(result SSHResult)\n```\n\n```go\nfunc LogSuspiciousLatency(latencyData []PodLatencyData, latencyDataLag []PodLatencyData, nodeCount int, c *client.Client)\n```\nLogSuspiciousLatency logs metrics/docker errors from all nodes that had slow startup times If latencyDataLag is nil then it will be populated from latencyData\n\n```go\nfunc Logf(format string, args ...interface{})\n```\n\n```go\nfunc LookForString(expectedString string, timeout time.Duration, fn func() string) (result string, err error)\n```\nLooks for the given string in the output of fn, repeatedly calling fn until the timeout is reached or the string is found. Returns last log and possibly error if the string was not found.\n\n```go\nfunc LookForStringInFile(ns, podName, container, file, expectedString string, timeout time.Duration) (result string, err error)\n```\nLooks for the given string in a file in a specific pod container\n\n```go\nfunc LookForStringInLog(ns, podName, container, expectedString string, timeout time.Duration) (result string, err error)\n```\nLooks for the given string in the log of a specific pod container\n\n```go\nfunc LookForStringInPodExec(ns, podName string, command []string, expectedString string, timeout time.Duration) (result string, err error)\n```\nLooks for the given string in the output of a command executed in a specific pod container\n\n```go\nfunc MigRollingUpdate(tmpl string, nt time.Duration) error\n```\nMigRollingUpdate starts a MIG rolling update, upgrading the nodes to a new instance template named tmpl, and waits up to nt times the number of nodes for it to complete.\n\n```go\nfunc MigTemplate() (string, error)\n```\nMigTemplate (GCE-only) returns the name of the MIG template that the nodes of the cluster use.\n\n```go\nfunc NewHostExecPodSpec(ns, name string) *api.Pod\n```\nNewHostExecPodSpec returns the pod spec of hostexec pod\n\n```go\nfunc NewKubectlCommand(args ...string) *kubectlBuilder\n```\n\n```go\nfunc NewResourceUsageGatherer(c *client.Client, options ResourceGathererOptions) (*containerResourceGatherer, error)\n```\n\n```go\nfunc NodeAddresses(nodelist *api.NodeList, addrType api.NodeAddressType) []string\n```\nNodeAddresses returns the first address of the given type of each node.\n\n```go\nfunc NodeProxyRequest(c *client.Client, node, endpoint string) (restclient.Result, error)\n```\nNodeProxyRequest performs a get on a node proxy endpoint given the nodename and rest client.\n\n```go\nfunc NodeSSHHosts(c *client.Client) ([]string, error)\n```\nNodeSSHHosts returns SSH-able host names for all schedulable nodes - this excludes master node. It returns an error if it can't find an external IP for every node, though it still returns all hosts that it found in that case.\n\n```go\nfunc OpenWebSocketForURL(url *url.URL, config *restclient.Config, protocols []string) (*websocket.Conn, error)\n```\nOpenWebSocketForURL constructs a websocket connection to the provided URL, using the client config, with the specified protocols.\n\n```go\nfunc ParseKVLines(output, key string) string\n```\nParseKVLines parses output that looks like lines containing \"\\\u003ckey\u003e: \\\u003cval\u003e\" and returns \\\u003cval\u003e if \\\u003ckey\u003e is found. Otherwise, it returns the empty string.\n\n```go\nfunc PodNotReady(p *api.Pod) (bool, error)\n```\nPodNotReady checks whether pod p's has a ready condition of status false.\n\n```go\nfunc PodProxyResponseChecker(c *client.Client, ns string, label labels.Selector, controllerName string, respondName bool, pods *api.PodList) podProxyResponseChecker\n```\n\n```go\nfunc PodRunningReady(p *api.Pod) (bool, error)\n```\nPodRunningReady checks whether pod p's phase is running and it has a ready condition of status true.\n\n```go\nfunc PodRunningReadyOrSucceeded(p *api.Pod) (bool, error)\n```\n\n```go\nfunc PodsCreated(c *client.Client, ns, name string, replicas int32) (*api.PodList, error)\n```\n\n```go\nfunc PodsResponding(c *client.Client, ns, name string, wantName bool, pods *api.PodList) error\n```\n\n```go\nfunc PrettyPrintJSON(metrics interface{}) string\n```\n\n```go\nfunc PrintAllKubeletPods(c *client.Client, nodeName string)\n```\n\n```go\nfunc PrintLatencies(latencies []PodLatencyData, header string)\n```\n\n```go\nfunc PrintPerfData(p *perftype.PerfData)\n```\nPrintPerfData prints the perfdata in json format with PerfResultTag prefix. If an error occurs, nothing will be printed.\n\n```go\nfunc ProviderIs(providers ...string) bool\n```\n\n```go\nfunc ReadOrDie(filePath string) []byte\n```\nReadOrDie reads a file from gobindata.  To generate gobindata, run\n\n\\# Install the program go get -u github.com/jteeuwen/go-bindata/...\n\n### Generate the bindata file. {#hdr-Generate_the_bindata_file_}\n\n\tgo-bindata \\\n\t  -pkg generated -ignore .jpg -ignore .png -ignore .md \\\n\t  ./examples/* ./docs/user-guide/* test/e2e/testing-manifests/kubectl/* test/images/*\n\n\\# Copy it into the generated directory if the results are what you expected. cp bindata.go test/e2e/generated\n\n\\# Don't forget to gofmt it gofmt -s -w test/e2e/generated/bindata.go\n\n```go\nfunc RegisterFlags()\n```\n\n```go\nfunc RemoveCleanupAction(p CleanupActionHandle)\n```\nRemoveCleanupAction removes a function that was installed by AddCleanupAction.\n\n```go\nfunc ResetMetrics(c *client.Client) error\n```\nResets latency metrics in apiserver.\n\n```go\nfunc ResourceUsageToPerfData(usagePerNode ResourceUsagePerNode) *perftype.PerfData\n```\nResourceUsageToPerfData transforms ResourceUsagePerNode to PerfData. Notice that this function only cares about memory usage, because cpu usage information will be extracted from NodesCPUSummary.\n\n```go\nfunc RestartApiserver(c *client.Client) error\n```\n\n```go\nfunc RestartKubeProxy(host string) error\n```\n\n```go\nfunc RunCleanupActions()\n```\nRunCleanupActions runs all functions installed by AddCleanupAction.  It does not remove them (see RemoveCleanupAction) but it does run unlocked, so they may remove themselves.\n\n```go\nfunc RunCmd(command string, args ...string) (string, string, error)\n```\nRunCmd runs cmd using args and returns its stdout and stderr. It also outputs cmd's stdout and stderr to their respective OS streams.\n\n```go\nfunc RunDeployment(config DeploymentConfig) error\n```\nRunDeployment Launches (and verifies correctness) of a Deployment and will wait for all pods it spawns to become \"Running\". It's the caller's responsibility to clean up externally (i.e. use the namespace lifecycle for handling Cleanup).\n\n```go\nfunc RunHostCmd(ns, name, cmd string) (string, error)\n```\nRunHostCmd runs the given cmd in the context of the given pod using \\`kubectl exec\\` inside of a shell.\n\n```go\nfunc RunHostCmdOrDie(ns, name, cmd string) string\n```\nRunHostCmdOrDie calls RunHostCmd and dies on error.\n\n```go\nfunc RunKubectl(args ...string) (string, error)\n```\nRunKubectl is a convenience wrapper over kubectlBuilder\n\n```go\nfunc RunKubectlOrDie(args ...string) string\n```\nRunKubectlOrDie is a convenience wrapper over kubectlBuilder\n\n```go\nfunc RunKubectlOrDieInput(data string, args ...string) string\n```\nRunKubectlOrDieInput is a convenience wrapper over kubectlBuilder that takes input to stdin\n\n```go\nfunc RunKubernetesServiceTestContainer(c *client.Client, repoRoot string, ns string)\n```\nRun a test container to try and contact the Kubernetes api-server from a pod, wait for it to flip to Ready, log its output and delete it.\n\n```go\nfunc RunRC(config RCConfig) error\n```\nRunRC Launches (and verifies correctness) of a Replication Controller and will wait for all pods it spawns to become \"Running\". It's the caller's responsibility to clean up externally (i.e. use the namespace lifecycle for handling Cleanup).\n\n```go\nfunc RunReplicaSet(config ReplicaSetConfig) error\n```\nRunReplicaSet launches (and verifies correctness) of a ReplicaSet and waits until all the pods it launches to reach the \"Running\" state. It's the caller's responsibility to clean up externally (i.e. use the namespace lifecycle for handling Cleanup).\n\n```go\nfunc ScaleRC(c *client.Client, ns, name string, size uint, wait bool) error\n```\n\n```go\nfunc ScaleRCByLabels(client *client.Client, ns string, l map[string]string, replicas uint) error\n```\nScaleRCByLabels scales an RC via ns/label lookup. If replicas == 0 it waits till none are running, otherwise it does what a synchronous scale operation would do.\n\n```go\nfunc ServerVersionGTE(v semver.Version, c discovery.ServerVersionInterface) (bool, error)\n```\nServerVersionGTE returns true if v is greater than or equal to the server version.\n\nTODO(18726): This should be incorporated into client.VersionInterface.\n\n```go\nfunc ServiceResponding(c *client.Client, ns, name string) error\n```\n\n```go\nfunc SkipIfProviderIs(unsupportedProviders ...string)\n```\n\n```go\nfunc SkipUnlessAtLeast(value int, minValue int, message string)\n```\n\n```go\nfunc SkipUnlessFederated(c *client.Client)\n```\nDetects whether the federation namespace exists in the underlying cluster\n\n```go\nfunc SkipUnlessNodeCountIsAtLeast(minNodeCount int)\n```\n\n```go\nfunc SkipUnlessProviderIs(supportedProviders ...string)\n```\n\n```go\nfunc SkipUnlessServerVersionGTE(v semver.Version, c discovery.ServerVersionInterface)\n```\n\n```go\nfunc Skipf(format string, args ...interface{})\n```\n\n```go\nfunc StartCmdAndStreamOutput(cmd *exec.Cmd) (stdout, stderr io.ReadCloser, err error)\n```\n\n```go\nfunc StartPods(c *client.Client, replicas int, namespace string, podNamePrefix string, pod api.Pod, waitForRunning bool)\n```\nSimplified version of RunRC, that does not create RC, but creates plain Pods. optionally waits for pods to start running (if waitForRunning == true)\n\n```go\nfunc TargetContainers() []string\n```\nA list of containers for which we want to collect resource usage.\n\n```go\nfunc TestContainerOutput(scenarioName string, c *client.Client, pod *api.Pod, containerIndex int, expectedOutput []string, ns string)\n```\nTestContainerOutput runs the given pod in the given namespace and waits for all of the containers in the podSpec to move into the 'Success' status, and tests the specified container log against the given expected output using a substring matcher.\n\n```go\nfunc TryKill(cmd *exec.Cmd)\n```\nRough equivalent of ctrl+c for cleaning up processes. Intended to be run in defer.\n\n```go\nfunc UnblockNetwork(from string, to string)\n```\n\n```go\nfunc UpdateDeploymentWithRetries(c *clientset.Clientset, namespace, name string, applyUpdate updateDeploymentFunc) (deployment *extensions.Deployment, err error)\n```\n\n```go\nfunc UpdatePodWithRetries(client *client.Client, ns, name string, update func(*api.Pod)) (*api.Pod, error)\n```\n\n```go\nfunc ValidateController(c *client.Client, containerImage string, replicas int, containername string, testname string, validator validatorFn, ns string)\n```\nValidateController is a generic mechanism for testing RC's that are running. It takes a container name, a test name, and a validator function which is plugged in by a specific test. \"containername\": this is grepped for. \"containerImage\" : this is the name of the image we expect to be launched.  Not to confuse w/ images (kitten.jpg)  which are validated. \"testname\":  which gets bubbled up to the logging/failure messages if errors happen. \"validator\" function: This function is given a podID and a client, and it can do some specific validations that way.\n\n```go\nfunc VerifyPodStartupLatency(latency PodStartupLatency) error\n```\nVerifies whether 50, 90 and 99th percentiles of PodStartupLatency are within the threshold.\n\n```go\nfunc VerifyPods(c *client.Client, ns, name string, wantName bool, replicas int32) error\n```\n\n```go\nfunc VerifySchedulerLatency(c *client.Client) error\n```\nVerifies (currently just by logging them) the scheduling latencies.\n\n```go\nfunc WaitForAllNodesSchedulable(c *client.Client) error\n```\n\n```go\nfunc WaitForApiserverUp(c *client.Client) error\n```\n\n```go\nfunc WaitForClusterSize(c *client.Client, size int, timeout time.Duration) error\n```\nWaitForClusterSize waits until the cluster has desired size and there is no not-ready nodes in it. By cluster size we mean number of Nodes excluding Master Node.\n\n```go\nfunc WaitForDefaultServiceAccountInNamespace(c *client.Client, namespace string) error\n```\nWaitForDefaultServiceAccountInNamespace waits for the default service account to be provisioned the default service account is what is associated with pods when they do not specify a service account as a result, pods are not able to be provisioned in a namespace until the service account is provisioned\n\n```go\nfunc WaitForDeploymentOldRSsNum(c *clientset.Clientset, ns, deploymentName string, desiredRSNum int) error\n```\nWaits for the deployment to clean up old rcs.\n\n```go\nfunc WaitForDeploymentRevisionAndImage(c clientset.Interface, ns, deploymentName string, revision, image string) error\n```\nWaitForDeploymentRevisionAndImage waits for the deployment's and its new RS's revision and container image to match the given revision and image. Note that deployment revision and its new RS revision should be updated shortly, so we only wait for 1 minute here to fail early.\n\n```go\nfunc WaitForDeploymentRollbackCleared(c clientset.Interface, ns, deploymentName string) error\n```\nWaitForDeploymentRollbackCleared waits for given deployment either started rolling back or doesn't need to rollback. Note that rollback should be cleared shortly, so we only wait for 1 minute here to fail early.\n\n```go\nfunc WaitForDeploymentStatus(c clientset.Interface, ns, deploymentName string, desiredUpdatedReplicas, minAvailable, maxCreated, minReadySeconds int32) error\n```\nWaits for the deployment to reach desired state. Returns an error if minAvailable or maxCreated is broken at any times.\n\n```go\nfunc WaitForDeploymentUpdatedReplicasLTE(c clientset.Interface, ns, deploymentName string, minUpdatedReplicas int, desiredGeneration int64) error\n```\nWaitForDeploymentUpdatedReplicasLTE waits for given deployment to be observed by the controller and has at least a number of updatedReplicas\n\n```go\nfunc WaitForEndpoint(c *client.Client, ns, name string) error\n```\n\n```go\nfunc WaitForEvents(c *client.Client, ns string, objOrRef runtime.Object, desiredEventsCount int) error\n```\nWaits for the number of events on the given object to reach a desired count.\n\n```go\nfunc WaitForFederationApiserverReady(c *federation_internalclientset.Clientset) error\n```\nWaitForFederationApiserverReady waits for the federation apiserver to be ready. It tests the readiness by sending a GET request and expecting a non error response.\n\n```go\nfunc WaitForIngressAddress(c *client.Client, ns, ingName string, timeout time.Duration) (string, error)\n```\nWaitForIngressAddress waits for the Ingress to acquire an address.\n\n```go\nfunc WaitForMatchPodsCondition(c *client.Client, opts api.ListOptions, desc string, timeout time.Duration, condition podCondition) error\n```\nWaitForMatchPodsCondition finds match pods based on the input ListOptions. waits and checks if all match pods are in the given podCondition\n\n```go\nfunc WaitForNamespacesDeleted(c *client.Client, namespaces []string, timeout time.Duration) error\n```\n\n```go\nfunc WaitForNodeToBe(c *client.Client, name string, conditionType api.NodeConditionType, wantTrue bool, timeout time.Duration) bool\n```\nWaitForNodeToBe returns whether node \"name's\" condition state matches wantTrue within timeout. If wantTrue is true, it will ensure the node condition status is ConditionTrue; if it's false, it ensures the node condition is in any state other than ConditionTrue (e.g. not true or unknown).\n\n```go\nfunc WaitForNodeToBeNotReady(c *client.Client, name string, timeout time.Duration) bool\n```\nWaitForNodeToBeNotReady returns whether node name is not ready (i.e. the readiness condition is anything but ready, e.g false or unknown) within timeout.\n\n```go\nfunc WaitForNodeToBeReady(c *client.Client, name string, timeout time.Duration) bool\n```\nWaitForNodeToBeReady returns whether node name is ready within timeout.\n\n```go\nfunc WaitForObservedDeployment(c *clientset.Clientset, ns, deploymentName string, desiredGeneration int64) error\n```\n\n```go\nfunc WaitForPartialEvents(c *client.Client, ns string, objOrRef runtime.Object, atLeastEventsCount int) error\n```\nWaits for the number of events on the given object to be at least a desired count.\n\n```go\nfunc WaitForPersistentVolumeClaimPhase(phase api.PersistentVolumeClaimPhase, c *client.Client, ns string, pvcName string, Poll, timeout time.Duration) error\n```\nWaitForPersistentVolumeClaimPhase waits for a PersistentVolumeClaim to be in a specific phase or until timeout occurs, whichever comes first.\n\n```go\nfunc WaitForPersistentVolumeDeleted(c *client.Client, pvName string, Poll, timeout time.Duration) error\n```\nWaitForPersistentVolumeDeleted waits for a PersistentVolume to get deleted or until timeout occurs, whichever comes first.\n\n```go\nfunc WaitForPersistentVolumePhase(phase api.PersistentVolumePhase, c *client.Client, pvName string, Poll, timeout time.Duration) error\n```\nWaitForPersistentVolumePhase waits for a PersistentVolume to be in a specific phase or until timeout occurs, whichever comes first.\n\n```go\nfunc WaitForPodNoLongerRunningInNamespace(c *client.Client, podName string, namespace string) error\n```\nWaits default amount of time (podNoLongerRunningTimeout) for the specified pod to stop running. Returns an error if timeout occurs first.\n\n```go\nfunc WaitForPodNotPending(c *client.Client, ns, podName string) error\n```\nWaitForPodNotPending returns an error if it took too long for the pod to go out of pending state.\n\n```go\nfunc WaitForPodRunningInNamespace(c *client.Client, podName string, namespace string) error\n```\nWaits default amount of time (PodStartTimeout) for the specified pod to become running. Returns an error if timeout occurs first, or pod goes in to failed state.\n\n```go\nfunc WaitForPodSuccessInNamespace(c *client.Client, podName string, contName string, namespace string) error\n```\nWaitForPodSuccessInNamespace returns nil if the pod reached state success, or an error if it reached failure or until podStartupTimeout.\n\n```go\nfunc WaitForPodSuccessInNamespaceSlow(c *client.Client, podName string, contName string, namespace string) error\n```\nWaitForPodSuccessInNamespaceSlow returns nil if the pod reached state success, or an error if it reached failure or until slowPodStartupTimeout.\n\n```go\nfunc WaitForPodToDisappear(c *client.Client, ns, podName string, label labels.Selector, interval, timeout time.Duration) error\n```\n\n```go\nfunc WaitForPodsReady(c *clientset.Clientset, ns, name string, minReadySeconds int) error\n```\n\n```go\nfunc WaitForPodsRunningReady(c *client.Client, ns string, minPods int32, timeout time.Duration, ignoreLabels map[string]string, restartDockerOnFailures bool) error\n```\nWaitForPodsRunningReady waits up to timeout to ensure that all pods in namespace ns are either running and ready, or failed but controlled by a replication controller. Also, it ensures that at least minPods are running and ready. It has separate behavior from other 'wait for' pods functions in that it requires the list of pods on every iteration. This is useful, for example, in cluster startup, because the number of pods increases while waiting. If ignoreLabels is not empty, pods matching this selector are ignored and this function waits for minPods to enter Running/Ready and for all pods matching ignoreLabels to enter Success phase. Otherwise an error is returned even if there are minPods pods, some of which are in Running/Ready and some in Success. This is to allow the client to decide if \"Success\" means \"Ready\" or not.\n\n```go\nfunc WaitForPodsSuccess(c *client.Client, ns string, successPodLabels map[string]string, timeout time.Duration) error\n```\nWaitForPodsSuccess waits till all labels matching the given selector enter the Success state. The caller is expected to only invoke this method once the pods have been created.\n\n```go\nfunc WaitForPodsWithLabel(c *client.Client, ns string, label labels.Selector) (pods *api.PodList, err error)\n```\nWait up to PodListTimeout for getting pods with certain label\n\n```go\nfunc WaitForPodsWithLabelRunning(c *client.Client, ns string, label labels.Selector) error\n```\nWait up to 10 minutes for all matching pods to become Running and at least one matching pod exists.\n\n```go\nfunc WaitForPodsWithLabelScheduled(c *client.Client, ns string, label labels.Selector) (pods *api.PodList, err error)\n```\nWait for all matching pods to become scheduled and at least one matching pod exists.  Return the list of matching pods.\n\n```go\nfunc WaitForRCPodToDisappear(c *client.Client, ns, rcName, podName string) error\n```\nWaitForRCPodToDisappear returns nil if the pod from the given replication controller (described by rcName) no longer exists. In case of failure or too long waiting time, an error is returned.\n\n```go\nfunc WaitForRCPodsRunning(c *client.Client, ns, rcName string) error\n```\nWait up to 10 minutes for pods to become Running. Assume that the pods of the rc are labels with {\"name\":rcName}.\n\n```go\nfunc WaitForRCToStabilize(c *client.Client, ns, name string, timeout time.Duration) error\n```\nWaitForRCToStabilize waits till the RC has a matching generation/replica count between spec and status.\n\n```go\nfunc WaitForReplicationController(c *client.Client, namespace, name string, exist bool, interval, timeout time.Duration) error\n```\nWaitForReplicationController waits until the RC appears (exist == true), or disappears (exist == false)\n\n```go\nfunc WaitForService(c *client.Client, namespace, name string, exist bool, interval, timeout time.Duration) error\n```\nWaitForService waits until the service appears (exist == true), or disappears (exist == false)\n\n```go\nfunc WaitForServiceEndpointsNum(c *client.Client, namespace, serviceName string, expectNum int, interval, timeout time.Duration) error\n```\nWaitForServiceEndpointsNum waits until the amount of endpoints that implement service to expectNum.\n\n## Types\n\n```go\ntype APICall struct {\n\tResource string        `json:\"resource\"`\n\tVerb     string        `json:\"verb\"`\n\tLatency  LatencyMetric `json:\"latency\"`\n}\n```\n\n```go\ntype APIResponsiveness struct {\n\tAPICalls []APICall `json:\"apicalls\"`\n}\n```\n\n```go\nfunc (a APIResponsiveness) Len() int\n```\n\n```go\nfunc (a APIResponsiveness) Less(i, j int) bool\n```\n\n```go\nfunc (a APIResponsiveness) Swap(i, j int)\n```\n\n```go\ntype CleanupActionHandle *int\n```\n\n```go\nfunc AddCleanupAction(fn func()) CleanupActionHandle\n```\nAddCleanupAction installs a function that will be called in the event of the whole test being terminated.  This allows arbitrary pieces of the overall test to hook into SynchronizedAfterSuite().\n\n```go\ntype ClientConfigGetter func() (*restclient.Config, error)\n```\n\n```go\ntype CloudConfig struct {\n\tProjectID         string\n\tZone              string\n\tCluster           string\n\tMasterName        string\n\tNodeInstanceGroup string\n\tNumNodes          int\n\tClusterTag        string\n\tServiceAccount    string\n\n\tProvider cloudprovider.Interface\n}\n```\n\n```go\ntype ClusterVerification struct {\n\t// contains filtered or unexported fields\n}\n```\n\n```go\nfunc (cl *ClusterVerification) ForEach(podFunc func(api.Pod)) error\n```\nForEach runs a function against every verifiable pod.  Be warned that this doesn't wait for \"n\" pods to verifiy, so it may return very quickly if you have strict pod state requirements.\n\nFor example, if you require at least 5 pods to be running before your test will pass, its smart to first call \"clusterVerification.WaitFor(5)\" before you call clusterVerification.ForEach.\n\n```go\nfunc (cl *ClusterVerification) WaitFor(atLeast int, timeout time.Duration) ([]api.Pod, error)\n```\nWaitFor waits for some minimum number of pods to be verified, according to the PodStateVerification definition.\n\n```go\nfunc (cl *ClusterVerification) WaitForOrFail(atLeast int, timeout time.Duration)\n```\nWaitForOrFail provides a shorthand WaitFor with failure as an option if anything goes wrong.\n\n```go\ntype ContainerFailures struct {\n\tRestarts int\n\t// contains filtered or unexported fields\n}\n```\n\n```go\ntype ContainerResourceUsage struct {\n\tName                    string\n\tTimestamp               time.Time\n\tCPUUsageInCores         float64\n\tMemoryUsageInBytes      uint64\n\tMemoryWorkingSetInBytes uint64\n\tMemoryRSSInBytes        uint64\n\t// The interval used to calculate CPUUsageInCores.\n\tCPUInterval time.Duration\n}\n```\n\n```go\ntype ContainersCPUSummary map[string]map[float64]float64\n```\nContainersCPUSummary is indexed by the container name with each entry a (percentile, value) map.\n\n```go\ntype CreateTestingNSFn func(baseName string, c *client.Client, labels map[string]string) (*api.Namespace, error)\n```\n\n```go\ntype DeploymentConfig struct {\n\tRCConfig\n}\n```\n\n```go\ntype E2EContext struct {\n\t// Raw context name,\n\tRawName string `yaml:\"rawName\"`\n\t// A valid dns subdomain which can be used as the name of kubernetes resources.\n\tName    string       `yaml:\"name\"`\n\tCluster *KubeCluster `yaml:\"cluster\"`\n\tUser    *KubeUser    `yaml:\"user\"`\n}\n```\n\n```go\ntype Framework struct {\n\tBaseName string\n\n\tClientConfigGetter ClientConfigGetter\n\tClient             *client.Client\n\tClientset_1_2      *release_1_2.Clientset\n\tClientset_1_3      *release_1_3.Clientset\n\n\t// TODO(mml): Remove this.  We should generally use the versioned clientset.\n\tFederationClientset     *federation_internalclientset.Clientset\n\tFederationClientset_1_3 *federation_release_1_3.Clientset\n\t// TODO: remove FederationClient, all the client access must be through FederationClientset\n\tFederationClient *unversionedfederation.FederationClient\n\n\tNamespace *api.Namespace // Every test has at least one namespace\n\n\tNamespaceDeletionTimeout time.Duration\n\n\t// Constraints that passed to a check which is executed after data is gathered to\n\t// see if 99% of results are within acceptable bounds. It as to be injected in the test,\n\t// as expectations vary greatly. Constraints are groupped by the container names.\n\tAddonResourceConstraints map[string]ResourceConstraint\n\t// contains filtered or unexported fields\n}\n```\nFramework supports common operations used by e2e tests; it will keep a client \u0026 a namespace for you. Eventual goal is to merge this with integration test framework.\n\n```go\nfunc NewDefaultFederatedFramework(baseName string) *Framework\n```\n\n```go\nfunc NewDefaultFramework(baseName string) *Framework\n```\nNewFramework makes a new framework and sets up a BeforeEach/AfterEach for you (you can write additional before/after each functions).\n\n```go\nfunc NewFramework(baseName string, options FrameworkOptions, client *client.Client) *Framework\n```\n\n```go\nfunc NewFrameworkWithConfigGetter(baseName string, options FrameworkOptions, client *client.Client, configGetter ClientConfigGetter) *Framework\n```\n\n```go\nfunc (f *Framework) AfterEach()\n```\nAfterEach deletes the namespace, after reading its events.\n\n```go\nfunc (f *Framework) BeforeEach()\n```\nBeforeEach gets a client and makes a namespace.\n\n```go\nfunc (f *Framework) CreateNamespace(baseName string, labels map[string]string) (*api.Namespace, error)\n```\n\n```go\nfunc (f *Framework) CreatePodsPerNodeForSimpleApp(appName string, podSpec func(n api.Node) api.PodSpec, maxCount int) map[string]string\n```\nCreatePodsPerNodeForSimpleApp Creates pods w/ labels.  Useful for tests which make a bunch of pods w/o any networking.\n\n```go\nfunc (f *Framework) CreateServiceForSimpleApp(contPort, svcPort int, appName string) *api.Service\n```\nCreateServiceForSimpleApp returns a service that selects/exposes pods (send -1 ports if no exposure needed) with an app label.\n\n```go\nfunc (f *Framework) CreateServiceForSimpleAppWithPods(contPort int, svcPort int, appName string, podSpec func(n api.Node) api.PodSpec, count int, block bool) (error, *api.Service)\n```\nCreateServiceForSimpleAppWithPods is a convenience wrapper to create a service and its matching pods all at once.\n\n```go\nfunc (f *Framework) GetUnderlyingFederatedContexts() []E2EContext\n```\n\n```go\nfunc (f *Framework) NewClusterVerification(filter PodStateVerification) *ClusterVerification\n```\n\n```go\nfunc (f *Framework) ReadFileViaContainer(podName, containerName string, path string) (string, error)\n```\nRead a file using kubectl exec cat \\\u003cpath\u003e\n\n```go\nfunc (f *Framework) TestContainerOutput(scenarioName string, pod *api.Pod, containerIndex int, expectedOutput []string)\n```\nRuns the given pod and verifies that the output of exact container matches the desired output.\n\n```go\nfunc (f *Framework) TestContainerOutputRegexp(scenarioName string, pod *api.Pod, containerIndex int, expectedOutput []string)\n```\nRuns the given pod and verifies that the output of exact container matches the desired regexps.\n\n```go\nfunc (f *Framework) WaitForAnEndpoint(serviceName string) error\n```\nWaitForAnEndpoint waits for at least one endpoint to become available in the service's corresponding endpoints object.\n\n```go\nfunc (f *Framework) WaitForPodNoLongerRunning(podName string) error\n```\nWaitForPodNoLongerRunning waits for the pod to no longer be running in the namespace, for either success or failure.\n\n```go\nfunc (f *Framework) WaitForPodReady(podName string) error\n```\nWaitForPodReady waits for the pod to flip to ready in the namespace.\n\n```go\nfunc (f *Framework) WaitForPodRunning(podName string) error\n```\nWaitForPodRunning waits for the pod to run in the namespace.\n\n```go\nfunc (f *Framework) WaitForPodRunningSlow(podName string) error\n```\nWaitForPodRunningSlow waits for the pod to run in the namespace. It has a longer timeout then WaitForPodRunning (util.slowPodStartTimeout).\n\n```go\nfunc (f *Framework) WaitForPodTerminated(podName, reason string) error\n```\nWaitForPodTerminated waits for the pod to be terminated with the given reason.\n\n```go\nfunc (f *Framework) WriteFileViaContainer(podName, containerName string, path string, contents string) error\n```\nWrite a file using kubectl exec echo \\\u003ccontents\u003e \u003e \\\u003cpath\u003e via specified container Because of the primitive technique we're using here, we only allow ASCII alphanumeric characters\n\n```go\ntype FrameworkOptions struct {\n\tClientQPS   float32\n\tClientBurst int\n}\n```\n\n```go\ntype InvariantFunc func(older, newer runtime.Object) error\n```\n\n```go\ntype KubeCluster struct {\n\tName    string `yaml:\"name\"`\n\tCluster struct {\n\t\tCertificateAuthorityData string `yaml:\"certificate-authority-data\"`\n\t\tServer                   string `yaml:\"server\"`\n\t} `yaml:\"cluster\"`\n}\n```\n\n```go\ntype KubeConfig struct {\n\tContexts []struct {\n\t\tName    string `yaml:\"name\"`\n\t\tContext struct {\n\t\t\tCluster string `yaml:\"cluster\"`\n\t\t\tUser    string\n\t\t} `yaml:\"context\"`\n\t} `yaml:\"contexts\"`\n\n\tClusters []KubeCluster `yaml:\"clusters\"`\n\n\tUsers []KubeUser `yaml:\"users\"`\n}\n```\n\n```go\ntype KubeUser struct {\n\tName string `yaml:\"name\"`\n\tUser struct {\n\t\tUsername string `yaml:\"username\"`\n\t\tPassword string `yaml:\"password\"`\n\t\tToken    string `yaml:\"token\"`\n\t} `yaml:\"user\"`\n}\n```\n\n```go\ntype KubeletLatencyMetric struct {\n\t// eg: list, info, create\n\tOperation string\n\t// eg: sync_pods, pod_worker\n\tMethod string\n\t// 0 \u003c= quantile \u003c=1, e.g. 0.95 is 95%tile, 0.5 is median.\n\tQuantile float64\n\tLatency  time.Duration\n}\n```\nKubeletMetric stores metrics scraped from the kubelet server's /metric endpoint. TODO: Get some more structure around the metrics and this type\n\n```go\ntype KubeletLatencyMetrics []KubeletLatencyMetric\n```\nKubeletMetricByLatency implements sort.Interface for \\[]KubeletMetric based on the latency field.\n\n```go\nfunc GetKubeletLatencyMetrics(ms metrics.KubeletMetrics) KubeletLatencyMetrics\n```\nGetKubeletLatencyMetrics gets all latency related kubelet metrics. Note that the KubeletMetrcis passed in should not contain subsystem prefix.\n\n```go\nfunc HighLatencyKubeletOperations(c *client.Client, threshold time.Duration, nodeName string) (KubeletLatencyMetrics, error)\n```\nHighLatencyKubeletOperations logs and counts the high latency metrics exported by the kubelet server via /metrics.\n\n```go\nfunc (a KubeletLatencyMetrics) Len() int\n```\n\n```go\nfunc (a KubeletLatencyMetrics) Less(i, j int) bool\n```\n\n```go\nfunc (a KubeletLatencyMetrics) Swap(i, j int)\n```\n\n```go\ntype LatencyMetric struct {\n\tPerc50 time.Duration `json:\"Perc50\"`\n\tPerc90 time.Duration `json:\"Perc90\"`\n\tPerc99 time.Duration `json:\"Perc99\"`\n}\n```\nDashboard metrics\n\n```go\nfunc ExtractLatencyMetrics(latencies []PodLatencyData) LatencyMetric\n```\n\n```go\ntype LatencySlice []PodLatencyData\n```\n\n```go\nfunc (a LatencySlice) Len() int\n```\n\n```go\nfunc (a LatencySlice) Less(i, j int) bool\n```\n\n```go\nfunc (a LatencySlice) Swap(i, j int)\n```\n\n```go\ntype LogSizeDataTimeseries map[string]map[string][]TimestampedSize\n```\n\n```go\ntype LogSizeGatherer struct {\n\t// contains filtered or unexported fields\n}\n```\nLogSizeGatherer is a worker which grabs a WorkItem from the channel and does assigned work.\n\n```go\nfunc (g *LogSizeGatherer) Run()\n```\n\n```go\nfunc (g *LogSizeGatherer) Work() bool\n```\nWork does a single unit of work: tries to take out a WorkItem from the queue, ssh-es into a given machine, gathers data, writes it to the shared \\\u003cdata\u003e map, and creates a gorouting which reinserts work item into the queue with a \\\u003cpollingPeriod\u003e delay. Returns false if worker should exit.\n\n```go\ntype LogsSizeData struct {\n\t// contains filtered or unexported fields\n}\n```\n\n```go\nfunc (d *LogsSizeData) AddNewData(ip, path string, timestamp time.Time, size int)\n```\n\n```go\ntype LogsSizeDataSummary map[string]map[string]SingleLogSummary\n```\nnode -\u003e file -\u003e data\n\n```go\nfunc (s *LogsSizeDataSummary) PrintHumanReadable() string\n```\nTODO: make sure that we don't need locking here\n\n```go\nfunc (s *LogsSizeDataSummary) PrintJSON() string\n```\n\n```go\ntype LogsSizeVerifier struct {\n\t// contains filtered or unexported fields\n}\n```\nLogsSizeVerifier gathers data about log files sizes from master and node machines. It oversees a \\\u003cworkersNo\u003e workers which do the gathering.\n\n```go\nfunc NewLogsVerifier(c *client.Client, stopChannel chan bool) *LogsSizeVerifier\n```\nNewLogsVerifier creates a new LogsSizeVerifier which will stop when stopChannel is closed\n\n```go\nfunc (s *LogsSizeVerifier) GetSummary() *LogsSizeDataSummary\n```\nGetSummary returns a summary (average generation rate and number of probes) of the data gathered by LogSizeVerifier\n\n```go\nfunc (v *LogsSizeVerifier) Run()\n```\nRun starts log size gathering. It starts a gorouting for every worker and then blocks until stopChannel is closed\n\n```go\ntype MetricsForE2E metrics.MetricsCollection\n```\n\n```go\nfunc (m *MetricsForE2E) PrintHumanReadable() string\n```\n\n```go\nfunc (m *MetricsForE2E) PrintJSON() string\n```\n\n```go\ntype NodeRuntimeOperationErrorRate map[string]*RuntimeOperationErrorRate\n```\nNodeRuntimeOperationErrorRate is the runtime operation error rate on one node.\n\n```go\ntype NodesCPUSummary map[string]ContainersCPUSummary\n```\nNodesCPUSummary is indexed by the node name with each entry a ContainersCPUSummary map.\n\n```go\ntype PodDiff map[string]*podInfo\n```\nPodDiff is a map of pod name to podInfos\n\n```go\nfunc Diff(oldPods []*api.Pod, curPods []*api.Pod) PodDiff\n```\nDiff computes a PodDiff given 2 lists of pods.\n\n```go\nfunc (p PodDiff) Print(ignorePhases sets.String)\n```\nPrint formats and prints the give PodDiff.\n\n```go\ntype PodLatencyData struct {\n\t// Name of the pod\n\tName string\n\t// Node this pod was running on\n\tNode string\n\t// Latency information related to pod startuptime\n\tLatency time.Duration\n}\n```\nPodLatencyData encapsulates pod startup latency information.\n\n```go\ntype PodStartupLatency struct {\n\tLatency LatencyMetric `json:\"latency\"`\n}\n```\n\n```go\ntype PodStateVerification struct {\n\t// Optional: only pods that have k=v labels will pass this filter.\n\tSelectors map[string]string\n\n\t// Required: The phases which are valid for your pod.\n\tValidPhases []api.PodPhase\n\n\t// Optional: only pods passing this function will pass the filter\n\t// Verify a pod.\n\t// As an optimization, in addition to specfying filter (boolean),\n\t// this function allows specifying an error as well.\n\t// The error indicates that the polling of the pod spectrum should stop.\n\tVerify func(api.Pod) (bool, error)\n\n\t// Optional: only pods with this name will pass the filter.\n\tPodName string\n}\n```\nPodStateVerification represents a verification of pod state. Any time you have a set of pods that you want to operate against or query, this struct can be used to declaratively identify those pods.\n\n```go\ntype PodStore struct {\n\tcache.Store\n\t// contains filtered or unexported fields\n}\n```\nConvenient wrapper around cache.Store that returns list of api.Pod instead of interface{}.\n\n```go\nfunc NewPodStore(c *client.Client, namespace string, label labels.Selector, field fields.Selector) *PodStore\n```\n\n```go\nfunc (s *PodStore) List() []*api.Pod\n```\n\n```go\nfunc (s *PodStore) Stop()\n```\n\n```go\ntype RCConfig struct {\n\tClient         *client.Client\n\tImage          string\n\tCommand        []string\n\tName           string\n\tNamespace      string\n\tPollInterval   time.Duration\n\tTimeout        time.Duration\n\tPodStatusFile  *os.File\n\tReplicas       int\n\tCpuRequest     int64 // millicores\n\tCpuLimit       int64 // millicores\n\tMemRequest     int64 // bytes\n\tMemLimit       int64 // bytes\n\tReadinessProbe *api.Probe\n\tDNSPolicy      *api.DNSPolicy\n\n\t// Env vars, set the same for every pod.\n\tEnv map[string]string\n\n\t// Extra labels added to every pod.\n\tLabels map[string]string\n\n\t// Node selector for pods in the RC.\n\tNodeSelector map[string]string\n\n\t// Ports to declare in the container (map of name to containerPort).\n\tPorts map[string]int\n\t// Ports to declare in the container as host and container ports.\n\tHostPorts map[string]int\n\n\tVolumes      []api.Volume\n\tVolumeMounts []api.VolumeMount\n\n\t// Pointer to a list of pods; if non-nil, will be set to a list of pods\n\t// created by this RC by RunRC.\n\tCreatedPods *[]*api.Pod\n\n\t// Maximum allowable container failures. If exceeded, RunRC returns an error.\n\t// Defaults to replicas*0.1 if unspecified.\n\tMaxContainerFailures *int\n\n\t// If set to false starting RC will print progress, otherwise only errors will be printed.\n\tSilent bool\n}\n```\n\n```go\ntype RCStartupStatus struct {\n\tExpected              int\n\tTerminating           int\n\tRunning               int\n\tRunningButNotReady    int\n\tWaiting               int\n\tPending               int\n\tUnknown               int\n\tInactive              int\n\tFailedContainers      int\n\tCreated               []*api.Pod\n\tContainerRestartNodes sets.String\n}\n```\n\n```go\nfunc ComputeRCStartupStatus(pods []*api.Pod, expected int) RCStartupStatus\n```\n\n```go\nfunc (s *RCStartupStatus) Print(name string)\n```\n\n```go\ntype ReplicaSetConfig struct {\n\tRCConfig\n}\n```\n\n```go\ntype ResourceConstraint struct {\n\tCPUConstraint    float64\n\tMemoryConstraint uint64\n}\n```\n\n```go\ntype ResourceGathererOptions struct {\n\t// contains filtered or unexported fields\n}\n```\n\n```go\ntype ResourceMonitor struct {\n\t// contains filtered or unexported fields\n}\n```\nResourceMonitor manages a resourceCollector per node.\n\n```go\nfunc NewResourceMonitor(c *client.Client, containerNames []string, pollingInterval time.Duration) *ResourceMonitor\n```\n\n```go\nfunc (r *ResourceMonitor) FormatCPUSummary(summary NodesCPUSummary) string\n```\n\n```go\nfunc (r *ResourceMonitor) FormatResourceUsage(s ResourceUsagePerNode) string\n```\n\n```go\nfunc (r *ResourceMonitor) GetCPUSummary() NodesCPUSummary\n```\n\n```go\nfunc (r *ResourceMonitor) GetLatest() (ResourceUsagePerNode, error)\n```\n\n```go\nfunc (r *ResourceMonitor) GetMasterNodeCPUSummary(summaryPerNode NodesCPUSummary) NodesCPUSummary\n```\n\n```go\nfunc (r *ResourceMonitor) GetMasterNodeLatest(usagePerNode ResourceUsagePerNode) ResourceUsagePerNode\n```\n\n```go\nfunc (r *ResourceMonitor) LogCPUSummary()\n```\n\n```go\nfunc (r *ResourceMonitor) LogLatest()\n```\n\n```go\nfunc (r *ResourceMonitor) Reset()\n```\n\n```go\nfunc (r *ResourceMonitor) Start()\n```\n\n```go\nfunc (r *ResourceMonitor) Stop()\n```\n\n```go\ntype ResourceUsagePerContainer map[string]*ContainerResourceUsage\n```\n\n```go\ntype ResourceUsagePerNode map[string]ResourceUsagePerContainer\n```\n\n```go\ntype ResourceUsageSummary map[string][]SingleContainerSummary\n```\nwe can't have int here, as JSON does not accept integer keys.\n\n```go\nfunc (s *ResourceUsageSummary) PrintHumanReadable() string\n```\n\n```go\nfunc (s *ResourceUsageSummary) PrintJSON() string\n```\n\n```go\ntype RuntimeOperationErrorRate struct {\n\tTotalNumber float64\n\tErrorRate   float64\n\tTimeoutRate float64\n}\n```\nRuntimeOperationErrorRate is the error rate of a specified runtime operation.\n\n```go\ntype RuntimeOperationMonitor struct {\n\t// contains filtered or unexported fields\n}\n```\nRuntimeOperationMonitor is the tool getting and parsing docker operation metrics.\n\n```go\nfunc NewRuntimeOperationMonitor(c *client.Client) *RuntimeOperationMonitor\n```\n\n```go\nfunc (m *RuntimeOperationMonitor) GetLatestRuntimeOperationErrorRate() map[string]NodeRuntimeOperationErrorRate\n```\nGetLatestRuntimeOperationErrorRate gets latest error rate and timeout rate from last observed RuntimeOperationErrorRate.\n\n```go\nfunc (m *RuntimeOperationMonitor) GetRuntimeOperationErrorRate() map[string]NodeRuntimeOperationErrorRate\n```\nGetRuntimeOperationErrorRate gets runtime operation records from kubelet metrics and calculate error rates of all runtime operations.\n\n```go\ntype SSHResult struct {\n\tUser   string\n\tHost   string\n\tCmd    string\n\tStdout string\n\tStderr string\n\tCode   int\n}\n```\n\n```go\nfunc SSH(cmd, host, provider string) (SSHResult, error)\n```\nSSH synchronously SSHs to a node running on provider and runs cmd. If there is no error performing the SSH, the stdout, stderr, and exit code are returned.\n\n```go\ntype SaturationTime struct {\n\tTimeToSaturate time.Duration `json:\"timeToStaturate\"`\n\tNumberOfNodes  int           `json:\"numberOfNodes\"`\n\tNumberOfPods   int           `json:\"numberOfPods\"`\n\tThroughput     float32       `json:\"throughput\"`\n}\n```\n\n```go\ntype SchedulingLatency struct {\n\tScheduling LatencyMetric `json:\"scheduling\"`\n\tBinding    LatencyMetric `json:\"binding\"`\n\tTotal      LatencyMetric `json:\"total\"`\n}\n```\n\n```go\ntype SingleContainerSummary struct {\n\tName string\n\tCpu  float64\n\tMem  uint64\n}\n```\n\n```go\ntype SingleLogSummary struct {\n\tAverageGenerationRate int\n\tNumberOfProbes        int\n}\n```\n\n```go\ntype TestContextType struct {\n\tKubeConfig         string\n\tKubeContext        string\n\tKubeAPIContentType string\n\tKubeVolumeDir      string\n\tCertDir            string\n\tHost               string\n\tRepoRoot           string\n\tProvider           string\n\tCloudConfig        CloudConfig\n\tKubectlPath        string\n\tOutputDir          string\n\tReportDir          string\n\tReportPrefix       string\n\tPrefix             string\n\tMinStartupPods     int\n\t// Timeout for waiting for system pods to be running\n\tSystemPodsStartupTimeout time.Duration\n\tUpgradeTarget            string\n\tPrometheusPushGateway    string\n\tOSDistro                 string\n\tVerifyServiceAccount     bool\n\tDeleteNamespace          bool\n\tCleanStart               bool\n\t// If set to 'true' or 'all' framework will start a goroutine monitoring resource usage of system add-ons.\n\t// It will read the data every 30 seconds from all Nodes and print summary during afterEach. If set to 'master'\n\t// only master Node will be monitored.\n\tGatherKubeSystemResourceUsageData string\n\tGatherLogsSizes                   bool\n\tGatherMetricsAfterTest            bool\n\t// Currently supported values are 'hr' for human-readable and 'json'. It's a comma separated list.\n\tOutputPrintType string\n\t// CreateTestingNS is responsible for creating namespace used for executing e2e tests.\n\t// It accepts namespace base name, which will be prepended with e2e prefix, kube client\n\t// and labels to be applied to a namespace.\n\tCreateTestingNS CreateTestingNSFn\n\t// If set to true test will dump data about the namespace in which test was running.\n\tDumpLogsOnFailure bool\n}\n```\n\n```go\nvar TestContext TestContextType\n```\n\n```go\ntype TestDataSummary interface {\n\tPrintHumanReadable() string\n\tPrintJSON() string\n}\n```\n\n```go\ntype TimestampedSize struct {\n\t// contains filtered or unexported fields\n}\n```\nTimestampedSize contains a size together with a time of measurement.\n\n```go\ntype WorkItem struct {\n\t// contains filtered or unexported fields\n}\n```\nWorkItem is a command for a worker that contains an IP of machine from which we want to gather data and paths to all files we're interested in.\n\n","path":"github.com/stackpointcloud/kubernetes/test/e2e/framework","name":"framework","synopsis":"This is a utility for prometheus pushing functionality.","isRedistributable":true}
