util

package
v0.4.2 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 31, 2015 License: Apache-2.0 Imports: 31 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CleanupServiceAndPod

func CleanupServiceAndPod(pod *kapi.Pod, service *kapi.Service, ns string)

CleanupServiceAndPod removes the Service and the Pod

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 CreatePodFromImage

func CreatePodFromImage(repo *imageapi.ImageRepository, ns string) *kapi.Pod

CreatePodFromImage creates a Pod from the latest image available in the Image Repository

func CreateSampleImageRepository

func CreateSampleImageRepository(namespace string) *imageapi.ImageRepository

CreateSampleImageRepository creates a ImageRepository in given namespace

func CreateServiceForPod

func CreateServiceForPod(pod *kapi.Pod, ns string) *kapi.Service

CreateServiceForPod creates a service to serve the provided Pod

func DeleteAllEtcdKeys

func DeleteAllEtcdKeys()

DeleteAllEtcdKeys removes all etcd keys

func DeleteSampleImageRepository

func DeleteSampleImageRepository(repo *imageapi.ImageRepository, namespace string)

DeleteSampleImageRepository removes the ImageRepository created in given namespace

func GetBaseDir

func GetBaseDir() string

GetBaseDir returns the base directory used for test.

func GetBuildFixture

func GetBuildFixture(filename string) *buildapi.Build

GetBuildFixture reads the Build JSON and returns and Build object

func GetClusterAdminClient

func GetClusterAdminClient(adminKubeConfigFile string) (*client.Client, error)

func GetClusterAdminClientConfig

func GetClusterAdminClientConfig(adminKubeConfigFile string) (*kclient.Config, error)

func GetClusterAdminKubeClient

func GetClusterAdminKubeClient(adminKubeConfigFile string) (*kclient.Client, error)

func GetEtcdURL

func GetEtcdURL() string

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 NewEtcdClient() *etcd.Client

func RandomNamespace

func RandomNamespace(prefix string) string

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 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(repo *imageapi.ImageRepository, ns string, validator ValidateFunc) error

VerifyImage verifies if the latest image in given ImageRepository is valid

func WaitForAddress

func WaitForAddress(pod *kapi.Pod, service *kapi.Service, ns string) (string, error)

WaitForAddress waits for the Pod to be running and then for the Service to get the endpoint.

Types

type ValidateFunc

type ValidateFunc func(string) error

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL