Documentation ¶
Index ¶
- Constants
- func CleanupServiceAndPod(pod *kapi.Pod, service *kapi.Service, ns string)
- func CreateBootstrapPolicy(masterArgs *start.MasterArgs) error
- func CreateMasterCerts(masterArgs *start.MasterArgs) error
- func CreateNamespace(clusterAdminKubeConfig, name string) (err error)
- func CreateNewProject(clusterAdminClient *client.Client, clientConfig kclient.Config, ...) (*client.Client, error)
- func CreateNodeCerts(nodeArgs *start.NodeArgs) error
- func CreatePodFromImage(stream *imageapi.ImageStream, tag, ns string) *kapi.Pod
- func CreateSampleImageStream(namespace string) *imageapi.ImageStream
- func CreateServiceForPod(pod *kapi.Pod, ns string) *kapi.Service
- func DefaultAllInOneOptions() (*configapi.MasterConfig, *configapi.NodeConfig, error)
- func DefaultMasterOptions() (*configapi.MasterConfig, error)
- func DeleteAllEtcdKeys()
- func DeleteSampleImageStream(stream *imageapi.ImageStream, namespace string)
- func FindAvailableBindAddress(lowPort, highPort int) (string, error)
- func GetBaseDir() string
- func GetBuildFixture(filename string) *buildapi.Build
- func GetClientForUser(clientConfig kclient.Config, username string) (*client.Client, error)
- func GetClusterAdminClient(adminKubeConfigFile string) (*client.Client, error)
- func GetClusterAdminClientConfig(adminKubeConfigFile string) (*kclient.Config, error)
- func GetClusterAdminKubeClient(adminKubeConfigFile string) (*kclient.Client, error)
- func GetEtcdURL() string
- func GetSecretFixture(filename string) *kapi.Secret
- func KubeConfigPath() string
- func Namespace() string
- func NewDockerClient() (*dockerClient.Client, error)
- func NewEtcdClient() *etcd.Client
- func RandomNamespace(prefix string) string
- func RequireDocker()
- func RequireEtcd()
- func RequireServer()
- func StartConfiguredAllInOne(masterConfig *configapi.MasterConfig, nodeConfig *configapi.NodeConfig) (string, error)
- func StartConfiguredMaster(masterConfig *configapi.MasterConfig) (string, error)
- func StartConfiguredMasterWithOptions(masterConfig *configapi.MasterConfig, testOptions TestOptions) (string, error)
- func StartTestAllInOne() (*configapi.MasterConfig, string, error)
- func StartTestMaster() (*configapi.MasterConfig, string, error)
- func VerifyImage(stream *imageapi.ImageStream, tag, ns string, validator ValidateFunc) error
- func WaitForAddress(pod *kapi.Pod, service *kapi.Service, ns string) (string, error)
- func WaitForPolicyUpdate(c *client.Client, namespace, verb, resource string, allowed bool) error
- func WaitForServiceAccounts(client *kclient.Client, namespace string, accounts []string) error
- type TestOptions
- type ValidateFunc
Constants ¶
const ( PolicyCachePollInterval = 100 * time.Millisecond PolicyCachePollTimeout = 5 * time.Second )
const ServiceAccountWaitTimeout = 30 * time.Second
ServiceAccountWaitTimeout is used to determine how long to wait for the service account controllers to start up, and populate the service accounts in the test namespace
Variables ¶
This section is empty.
Functions ¶
func CleanupServiceAndPod ¶
CleanupServiceAndPod removes the Service and the Pod
func CreateBootstrapPolicy ¶ added in v0.4.3
func CreateBootstrapPolicy(masterArgs *start.MasterArgs) error
func CreateMasterCerts ¶ added in v0.4.3
func CreateMasterCerts(masterArgs *start.MasterArgs) error
func CreateNamespace ¶ added in v0.4.4
CreateNamespace creates a namespace with the specified name using the provided kubeconfig DO NOT USE, use create project instead
func CreateNewProject ¶
func CreateNewProject(clusterAdminClient *client.Client, clientConfig kclient.Config, projectName, adminUser string) (*client.Client, error)
CreateNewProject creates a new project using the clusterAdminClient, then gets a token for the adminUser and returns back a client for the admin user
func CreateNodeCerts ¶ added in v0.4.3
func CreatePodFromImage ¶
func CreatePodFromImage(stream *imageapi.ImageStream, tag, ns string) *kapi.Pod
CreatePodFromImage creates a Pod from the latest image available in the Image Stream
func CreateSampleImageStream ¶ added in v0.4.3
func CreateSampleImageStream(namespace string) *imageapi.ImageStream
CreateSampleImageStream creates an ImageStream in given namespace
func CreateServiceForPod ¶
CreateServiceForPod creates a service to serve the provided Pod
func DefaultAllInOneOptions ¶ added in v0.4.3
func DefaultAllInOneOptions() (*configapi.MasterConfig, *configapi.NodeConfig, error)
func DefaultMasterOptions ¶ added in v0.4.3
func DefaultMasterOptions() (*configapi.MasterConfig, error)
func DeleteSampleImageStream ¶ added in v0.4.3
func DeleteSampleImageStream(stream *imageapi.ImageStream, namespace string)
DeleteSampleImageStream removes the ImageStream created in given namespace
func FindAvailableBindAddress ¶ added in v0.4.4
FindAvailableBindAddress returns a bind address on 127.0.0.1 with a free port in the low-high range. If lowPort is 0, an ephemeral port is allocated.
func GetBuildFixture ¶
GetBuildFixture reads the Build JSON and returns and Build object
func GetClientForUser ¶ added in v0.6.1
func GetClusterAdminClient ¶
func GetEtcdURL ¶
func GetEtcdURL() string
func GetSecretFixture ¶ added in v0.4.3
func KubeConfigPath ¶
func KubeConfigPath() string
func Namespace ¶
func Namespace() string
Namespace returns the test namespace. The default namespace is set to 'integration-test'. You can override it by setting the 'OS_TEST_NAMESPACE' environment variable
func NewDockerClient ¶
func NewDockerClient() (*dockerClient.Client, error)
newDockerClient creates a docker client using the env var DOCKER_ENDPOINT or, if not supplied, uses the default docker endpoint /var/run/docker.sock
func NewEtcdClient ¶
func RandomNamespace ¶
RandomNamespace provides random Kubernetes namespace name based on the UNIX timestamp. Optionally you can set the prefix.
func RequireDocker ¶
func RequireDocker()
RequireDocker ensures that a new docker client can be created and that a ListImages command can be run on the client or it fails with glog.Fatal
func RequireEtcd ¶
func RequireEtcd()
RequireEtcd verifies if the etcd is running and accessible for testing
func RequireServer ¶
func RequireServer()
RequireServer verifies if the etcd, docker and the OpenShift server are available and you can successfully connected to them.
func StartConfiguredAllInOne ¶ added in v0.4.3
func StartConfiguredAllInOne(masterConfig *configapi.MasterConfig, nodeConfig *configapi.NodeConfig) (string, error)
func StartConfiguredMaster ¶ added in v0.4.3
func StartConfiguredMaster(masterConfig *configapi.MasterConfig) (string, error)
func StartConfiguredMasterWithOptions ¶ added in v0.5.3
func StartConfiguredMasterWithOptions(masterConfig *configapi.MasterConfig, testOptions TestOptions) (string, error)
func StartTestAllInOne ¶
func StartTestAllInOne() (*configapi.MasterConfig, string, error)
func StartTestMaster ¶
func StartTestMaster() (*configapi.MasterConfig, string, error)
StartTestMaster starts up a test master and returns back the startOptions so you can get clients and certs
func VerifyImage ¶
func VerifyImage(stream *imageapi.ImageStream, tag, ns string, validator ValidateFunc) error
VerifyImage verifies if the latest image in given ImageStream is valid
func WaitForAddress ¶
WaitForAddress waits for the Pod to be running and then for the Service to get the endpoint.
func WaitForPolicyUpdate ¶ added in v1.0.1
WaitForPolicyUpdate checks if the given client can perform the named verb and action. If PolicyCachePollTimeout is reached without the expected condition matching, an error is returned
Types ¶
type TestOptions ¶ added in v0.5.3
type TestOptions struct {
DeleteAllEtcdKeys bool
}
func DefaultTestOptions ¶ added in v0.5.3
func DefaultTestOptions() TestOptions