Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CreateResource

func CreateResource(kubeconfig *restclient.Config, apiResource metav1.APIResource, desiredObj *unstructured.Unstructured) (*unstructured.Unstructured, error)

func GetTypeConfig

func GetTypeConfig(genericClient client.Client, name, namespace string) (typeconfig.Interface, error)

func NewDNSEndpoint

func NewDNSEndpoint(dnsName string, targets []string, recordType string, recordTTL dnsv1a1.TTL) *dnsv1a1.Endpoint

func NewDomainObject

func NewDomainObject(federation, domain string) *dnsv1a1.Domain

func NewEndpointObject

func NewEndpointObject(name, namespace string) *apiv1.Endpoints

func NewIngressDNSObject

func NewIngressDNSObject(baseName, namespace string) *dnsv1a1.IngressDNSRecord

func NewIngressObject

func NewIngressObject(name, namespace string) *extv1b1.Ingress

func NewServiceDNSObject

func NewServiceDNSObject(baseName, namespace string) *dnsv1a1.ServiceDNSRecord

func NewServiceObject

func NewServiceObject(name, namespace string) *apiv1.Service

func NewTestObject

func NewTestObject(typeConfig typeconfig.Interface, namespace string, clusterNames []string, fixture *unstructured.Unstructured) (*unstructured.Unstructured, error)

func NewTestTargetObject

func NewTestTargetObject(typeConfig typeconfig.Interface, namespace string, fixture *unstructured.Unstructured) (*unstructured.Unstructured, error)

func OverridesFromFixture

func OverridesFromFixture(clusterNames []string, fixture *unstructured.Unstructured) ([]interface{}, error)

func TypeConfigFixturesOrDie

func TypeConfigFixturesOrDie(tl TestLogger) map[string]*unstructured.Unstructured

func WaitForNamespaceOrDie

func WaitForNamespaceOrDie(tl TestLogger, client kubeclientset.Interface, clusterName, namespace string, interval, timeout time.Duration)

WaitForNamespace waits for namespace to be created in a cluster.

func WaitForObject

func WaitForObject(tl TestLogger, namespace, name string, objectGetter func(namespace, name string) (pkgruntime.Object, error), desired pkgruntime.Object, interval, timeout time.Duration)

WaitForObject waits for object to match the desired status.

Types

type FederatedTypeCrudTester

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

FederatedTypeCrudTester exercises Create/Read/Update/Delete operations for federated types via the Federation API and validates that the results of those operations are propagated to clusters that are members of a federation.

func NewFederatedTypeCrudTester

func NewFederatedTypeCrudTester(testLogger TestLogger, typeConfig typeconfig.Interface, kubeConfig *rest.Config, testClusters map[string]TestCluster, waitInterval, clusterWaitTimeout time.Duration) (*FederatedTypeCrudTester, error)

func (*FederatedTypeCrudTester) CheckCreate

func (c *FederatedTypeCrudTester) CheckCreate(targetObject *unstructured.Unstructured, overrides []interface{}) *unstructured.Unstructured

func (*FederatedTypeCrudTester) CheckDelete

func (c *FederatedTypeCrudTester) CheckDelete(fedObject *unstructured.Unstructured, orphanDependents bool)

func (*FederatedTypeCrudTester) CheckLifecycle

func (c *FederatedTypeCrudTester) CheckLifecycle(targetObject *unstructured.Unstructured, overrides []interface{})

func (*FederatedTypeCrudTester) CheckPlacementChange

func (c *FederatedTypeCrudTester) CheckPlacementChange(fedObject *unstructured.Unstructured)

CheckPlacementChange verifies that a change in the list of clusters in a placement resource has the desired impact on member cluster state.

func (*FederatedTypeCrudTester) CheckPropagation

func (c *FederatedTypeCrudTester) CheckPropagation(fedObject *unstructured.Unstructured)

CheckPropagation checks propagation for the crud tester's clients

func (*FederatedTypeCrudTester) CheckStatusCreated

func (c *FederatedTypeCrudTester) CheckStatusCreated(qualifiedName util.QualifiedName)

func (*FederatedTypeCrudTester) CheckUpdate

func (c *FederatedTypeCrudTester) CheckUpdate(fedObject *unstructured.Unstructured)

func (*FederatedTypeCrudTester) Create

func (c *FederatedTypeCrudTester) Create(targetObject *unstructured.Unstructured, overrides []interface{}) *unstructured.Unstructured

func (*FederatedTypeCrudTester) TestClusters

func (c *FederatedTypeCrudTester) TestClusters() map[string]TestCluster

type TestCluster

type TestCluster struct {
	TestClusterConfig
	Client util.ResourceClient
}

type TestClusterConfig

type TestClusterConfig struct {
	Config    *rest.Config
	IsPrimary bool
}

type TestLogger

type TestLogger interface {
	Errorf(format string, args ...interface{})
	Fatal(args ...interface{})
	Fatalf(format string, args ...interface{})
	Log(args ...interface{})
	Logf(format string, args ...interface{})
}

TestLogger defines operations common across different types of testing