common

package
v0.1.0-rc5 Latest Latest
Warning

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

Go to latest
Published: Aug 1, 2019 License: Apache-2.0 Imports: 34 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CreateResource added in v0.0.7

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

func Equivalent

func Equivalent(actual, desired pkgruntime.Object) bool

func GetGenericStatus

func GetGenericStatus(client genericclient.Client, gvk schema.GroupVersionKind,
	qualifiedName util.QualifiedName) (*status.GenericFederatedStatus, error)

GetGenericStatus retrieves a federated resource and converts it to the generic status interface.

func GetTypeConfig added in v0.0.7

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

func NewDNSEndpoint added in v0.0.2

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

func NewDomainObject added in v0.0.3

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

func NewEndpointObject

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

func NewIngressDNSObject added in v0.0.2

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

func NewIngressObject added in v0.0.2

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 added in v0.0.6

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

func NewTestTargetObject added in v0.0.7

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

func OverridesFromFixture added in v0.0.7

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

func TypeConfigFixturesOrDie added in v0.0.4

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

func ValidKubeFedCluster

func ValidKubeFedCluster() *v1beta1.KubeFedCluster

func WaitForNamespaceOrDie added in v0.0.2

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

WaitForNamespace waits for namespace to be created in a cluster.

Types

type FederatedTypeCrudTester

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

FederatedTypeCrudTester exercises Create/Read/Update/Delete operations for federated types via the KubeFed API and validates that the results of those operations are propagated to clusters registered with the KubeFed control plane.

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 added in v0.0.3

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 added in v0.0.2

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

type TestCluster

type TestCluster struct {
	TestClusterConfig
	Client util.ResourceClient
}

type TestClusterConfig added in v0.0.3

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

Jump to

Keyboard shortcuts

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