common

package
v0.5.0 Latest Latest
Warning

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

Go to latest
Published: Oct 23, 2020 License: Apache-2.0 Imports: 37 Imported by: 2

Documentation

Overview

Package common generated by go-bindata.// sources: test/common/fixtures/clusterroles.rbac.authorization.k8s.io.yaml test/common/fixtures/configmaps.yaml test/common/fixtures/deployments.apps.yaml test/common/fixtures/ingresses.extensions.yaml test/common/fixtures/jobs.batch.yaml test/common/fixtures/namespaces.yaml test/common/fixtures/replicasets.apps.yaml test/common/fixtures/secrets.yaml test/common/fixtures/serviceaccounts.yaml test/common/fixtures/services.yaml config/kubefedconfig.yaml config/enabletypedirectives/clusterroles.rbac.authorization.k8s.io.yaml config/enabletypedirectives/configmaps.yaml config/enabletypedirectives/deployments.apps.yaml config/enabletypedirectives/ingresses.extensions.yaml config/enabletypedirectives/jobs.batch.yaml config/enabletypedirectives/namespaces.yaml config/enabletypedirectives/replicasets.apps.yaml config/enabletypedirectives/secrets.yaml config/enabletypedirectives/serviceaccounts.yaml config/enabletypedirectives/services.yaml

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Asset added in v0.3.0

func Asset(name string) ([]byte, error)

Asset loads and returns the asset for the given name. It returns an error if the asset could not be found or could not be loaded.

func AssetDir added in v0.3.0

func AssetDir(name string) ([]string, error)

AssetDir returns the file names below a certain directory embedded in the file by go-bindata. For example if you run go-bindata on data/... and data contains the following hierarchy:

data/
  foo.txt
  img/
    a.png
    b.png

then AssetDir("data") would return []string{"foo.txt", "img"} AssetDir("data/img") would return []string{"a.png", "b.png"} AssetDir("foo.txt") and AssetDir("notexist") would return an error AssetDir("") will return []string{"data"}.

func AssetInfo added in v0.3.0

func AssetInfo(name string) (os.FileInfo, error)

AssetInfo loads and returns the asset info for the given name. It returns an error if the asset could not be found or could not be loaded.

func AssetNames added in v0.3.0

func AssetNames() []string

AssetNames returns the names of the assets.

func CreateResource added in v0.0.7

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

func DecodeYamlFromBindata added in v0.3.0

func DecodeYamlFromBindata(filename, prefix string, obj interface{}) (string, error)

func Equivalent added in v0.3.0

func Equivalent(actual, desired pkgruntime.Object) bool

func GetGenericResource added in v0.3.0

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

GetGenericResource retrieves a federated resource and converts it to the generic resource struct.

func GetTypeConfig added in v0.0.7

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

func MustAsset added in v0.3.0

func MustAsset(name string) []byte

MustAsset is like Asset but panics when Asset would return an error. It simplifies safe initialization of global variables.

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

func RestoreAsset(dir, name string) error

RestoreAsset restores an asset under the given directory

func RestoreAssets added in v0.3.0

func RestoreAssets(dir, name string) error

RestoreAssets restores an asset under the given directory recursively

func TypeConfigFixturesOrDie added in v0.0.4

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

func ValidKubeFedCluster added in v0.3.0

func ValidKubeFedCluster() *v1beta1.KubeFedCluster

func ValidKubeFedConfig added in v0.3.0

func ValidKubeFedConfig() *v1beta1.KubeFedConfig

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