managed

package
v0.0.6 Latest Latest
Warning

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

Go to latest
Published: Feb 21, 2019 License: Apache-2.0 Imports: 43 Imported by: 0

Documentation

Index

Constants

View Source
const (
	DefaultWaitInterval = 50 * time.Millisecond
)

Variables

This section is empty.

Functions

func CreateKubeConfig

func CreateKubeConfig(clientCfg *rest.Config) *clientcmdapi.Config

CreateKubeConfig transforms a rest config to a cli config.

func CreateTestNamespace

func CreateTestNamespace(tl common.TestLogger, client kubeclientset.Interface, baseName string) string

func FindFreeLocalPort

func FindFreeLocalPort() (int, error)

FindFreeLocalPort returns the number of an available port number on the loopback interface. Useful for determining the port to launch a server on. Error handling required - there is a non-zero chance that the returned port number will be bound by another process after this function returns.

func ListFederatedClusters

func ListFederatedClusters(tl common.TestLogger, client fedclientset.Interface, namespace string) *fedv1a1.FederatedClusterList

func NewIntegrationLogger

func NewIntegrationLogger(t *testing.T) common.TestLogger

func SetUpEtcd

func SetUpEtcd(tl common.TestLogger) *url.URL

func TearDownEtcd

func TearDownEtcd(tl common.TestLogger)

func TearDownOnPanic

func TearDownOnPanic(tl common.TestLogger, f TestFixture)

TearDownOnPanic can be used to ensure cleanup on setup failure.

func WaitForClusterReadiness

func WaitForClusterReadiness(tl common.TestLogger, client fedclientset.Interface,
	namespace string, interval, timeout time.Duration)

Types

type ControllerFixture

type ControllerFixture struct {
	// contains filtered or unexported fields
}

ControllerFixture manages a federation controller for testing.

func NewClusterControllerFixture

func NewClusterControllerFixture(config *util.ControllerConfig) *ControllerFixture

NewClusterControllerFixture initializes a new cluster controller fixture.

func NewIngressDNSControllerFixture

func NewIngressDNSControllerFixture(tl common.TestLogger, config *util.ControllerConfig) *ControllerFixture

NewIngressDNSControllerFixture initializes a new ingress-dns controller fixture.

func NewSchedulerControllerFixture added in v0.0.4

func NewSchedulerControllerFixture(tl common.TestLogger, config *util.ControllerConfig) *ControllerFixture

func NewServiceDNSControllerFixture

func NewServiceDNSControllerFixture(tl common.TestLogger, config *util.ControllerConfig) *ControllerFixture

NewServiceDNSControllerFixture initializes a new service-dns controller fixture.

func NewSyncControllerFixture

func NewSyncControllerFixture(tl common.TestLogger, controllerConfig *util.ControllerConfig, typeConfig typeconfig.Interface, namespacePlacement *metav1.APIResource) *ControllerFixture

NewSyncControllerFixture initializes a new sync controller fixture.

func (*ControllerFixture) TearDown

func (f *ControllerFixture) TearDown(tl common.TestLogger)

type FederationFixture

type FederationFixture struct {
	KubeApi           *KubernetesApiFixture
	Clusters          map[string]*KubernetesApiFixture
	ClusterController *ControllerFixture
	SystemNamespace   string
}

FederationFixture manages servers for kube, cluster registry and federation along with a set of member clusters.

func SetUpFederationFixture

func SetUpFederationFixture(tl common.TestLogger, clusterCount int) *FederationFixture

func (*FederationFixture) AddMemberCluster

func (f *FederationFixture) AddMemberCluster(tl common.TestLogger) string

AddCluster adds a new member cluster to the federation.

func (*FederationFixture) ClusterConfigs

func (f *FederationFixture) ClusterConfigs(tl common.TestLogger, userAgent string) map[string]common.TestClusterConfig

func (*FederationFixture) ClusterDynamicClients

func (f *FederationFixture) ClusterDynamicClients(tl common.TestLogger, apiResource *metav1.APIResource, userAgent string) map[string]common.TestCluster

func (*FederationFixture) ClusterKubeClients

func (f *FederationFixture) ClusterKubeClients(tl common.TestLogger, userAgent string) map[string]kubeclientset.Interface

func (*FederationFixture) ClusterNames

func (f *FederationFixture) ClusterNames() []string

func (*FederationFixture) ControllerConfig

func (f *FederationFixture) ControllerConfig(tl common.TestLogger) *util.ControllerConfig

func (*FederationFixture) NewCrClient

func (f *FederationFixture) NewCrClient(tl common.TestLogger, userAgent string) crclientset.Interface

func (*FederationFixture) NewFedClient

func (f *FederationFixture) NewFedClient(tl common.TestLogger, userAgent string) fedclientset.Interface

func (*FederationFixture) TearDown

func (f *FederationFixture) TearDown(tl common.TestLogger)

type InstallStrategy

type InstallStrategy struct {
	install.EmptyInstallStrategy
	// contains filtered or unexported fields
}

func (*InstallStrategy) GetCRDs

type KubernetesApiFixture

type KubernetesApiFixture struct {
	EtcdUrl   *url.URL
	Host      string
	ApiServer *integration.APIServer
	IsPrimary bool
}

KubernetesApiFixture manages a kubernetes api server

func SetUpKubernetesApiFixture

func SetUpKubernetesApiFixture(tl common.TestLogger) *KubernetesApiFixture

func (*KubernetesApiFixture) NewClient

func (f *KubernetesApiFixture) NewClient(tl common.TestLogger, userAgent string) clientset.Interface

func (*KubernetesApiFixture) NewConfig

func (f *KubernetesApiFixture) NewConfig(tl common.TestLogger) *rest.Config

func (*KubernetesApiFixture) TearDown

func (f *KubernetesApiFixture) TearDown(tl common.TestLogger)

type SecureConfigFixture

type SecureConfigFixture struct {
	CertDir      string
	ServerCAFile string
	Key          *rsa.PrivateKey
	CACert       *x509.Certificate
	CACertFile   string
}

func SetUpSecureConfigFixture

func SetUpSecureConfigFixture(tl common.TestLogger) *SecureConfigFixture

func (*SecureConfigFixture) NewClientConfig

func (f *SecureConfigFixture) NewClientConfig(tl common.TestLogger, host string) *rest.Config

func (*SecureConfigFixture) TearDown

func (f *SecureConfigFixture) TearDown(tl common.TestLogger)

type TestFixture

type TestFixture interface {
	TearDown(tl common.TestLogger)
}

SetUp is likely to be fixture-specific, but TearDown needs to be consistent to enable TearDownOnPanic.

Jump to

Keyboard shortcuts

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