testkit

package
v0.0.0-...-4315425 Latest Latest
Warning

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

Go to latest
Published: Mar 25, 2022 License: Apache-2.0 Imports: 23 Imported by: 6

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ShouldLastFor

func ShouldLastFor(interval, timeout time.Duration, conditionalFunc func() bool) error

func WaitForFunction

func WaitForFunction(interval, timeout time.Duration, conditionalFunc func() bool) error

Types

type HelmClient

type HelmClient interface {
	CheckReleaseStatus(rlsName string, namespace string) (release.Status, error)
	CheckReleaseExistence(rlsName string, namespace string) (bool, error)
	IsInstalled(rlsName string, namespace string) bool
	TestRelease(rlsName string, namespace string) (*release.Release, error)
	GetRelease(rlsName string, namespace string) (*release.Release, error)
}

func NewHelmClient

func NewHelmClient(helmDriver string) (HelmClient, error)

type K8sResourceChecker

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

func NewAppK8sChecker

func NewAppK8sChecker(client K8sResourcesClient, appName string, checkGateway bool, checkValidator bool) *K8sResourceChecker

func NewServiceInstanceK8SChecker

func NewServiceInstanceK8SChecker(client K8sResourcesClient, releaseName string) *K8sResourceChecker

func (*K8sResourceChecker) CheckK8sResourceRemoved

func (c *K8sResourceChecker) CheckK8sResourceRemoved(t *testing.T)

func (*K8sResourceChecker) CheckK8sResourcesDeployed

func (c *K8sResourceChecker) CheckK8sResourcesDeployed(t *testing.T)

type K8sResourcesClient

type K8sResourcesClient interface {
	GetDeployment(ctx context.Context, name string, options metav1.GetOptions) (interface{}, error)
	GetService(ctx context.Context, name string, options metav1.GetOptions) (interface{}, error)
	GetVirtualService(ctx context.Context, name string, options metav1.GetOptions) (interface{}, error)
	GetRole(ctx context.Context, name string, options metav1.GetOptions) (interface{}, error)
	GetRoleBinding(ctx context.Context, name string, options metav1.GetOptions) (interface{}, error)
	GetClusterRole(ctx context.Context, name string, options metav1.GetOptions) (interface{}, error)
	GetClusterRoleBinding(ctx context.Context, name string, options metav1.GetOptions) (interface{}, error)
	GetServiceAccount(ctx context.Context, name string, options metav1.GetOptions) (interface{}, error)
	CreateDummyApplication(ctx context.Context, name string, accessLabel string, skipInstallation bool) (*v1alpha1.Application, error)
	CreateLabeledApplication(ctx context.Context, name string, labels map[string]string) (*v1alpha1.Application, error)
	DeleteApplication(ctx context.Context, name string, options metav1.DeleteOptions) error
	GetApplication(ctx context.Context, name string, options metav1.GetOptions) (*v1alpha1.Application, error)
	ListPods(ctx context.Context, options metav1.ListOptions) (*corev1.PodList, error)
	DeletePod(ctx context.Context, name string, options metav1.DeleteOptions) error
	GetLogs(ctx context.Context, podName string, options *corev1.PodLogOptions) *restclient.Request
	CreateNamespace(ctx context.Context, namespace *corev1.Namespace) (*corev1.Namespace, error)
	DeleteNamespace(ctx context.Context) error
	CreateServiceInstance(ctx context.Context, serviceInstance *v1beta1.ServiceInstance) (*v1beta1.ServiceInstance, error)
	DeleteServiceInstance(ctx context.Context, name string) error
	UpdateApplication(ctx context.Context, application *v1alpha1.Application) (*v1alpha1.Application, error)
}

func NewK8sResourcesClient

func NewK8sResourcesClient(namespace string) (K8sResourcesClient, error)

type TestConfig

type TestConfig struct {
	Namespace                               string
	HelmDriver                              string
	InstallationTimeoutSeconds              int
	GatewayOncePerNamespace                 bool
	CentralApplicationConnectivityValidator bool
}

func ReadConfig

func ReadConfig() (TestConfig, error)

Jump to

Keyboard shortcuts

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