framework

package
v1.14.0 Latest Latest
Warning

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

Go to latest
Published: Sep 4, 2024 License: Apache-2.0 Imports: 45 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ServiceAccountName            = "e2e-user"
	ServiceAccountTokenSecretName = "e2e-user-token"
)
View Source
const (
	SerialLabelName          = "Serial"
	MultiDatacenterLabelName = "MultiDatacenter"

	RequiresClusterIPLabelName     = "RequiresClusterIP"
	RequiresObjectStorageLabelName = "RequiresObjectStorage"
)

Variables

View Source
var (
	Serial = []interface{}{
		g.Serial,
		g.Label(SerialLabelName),
	}
	MultiDatacenter = g.Label(MultiDatacenterLabelName)

	RequiresClusterIP     = g.Label(RequiresClusterIPLabelName)
	RequiresObjectStorage = g.Label(RequiresObjectStorageLabelName)
)

Functions

func By

func By(format string, args ...interface{})

func DumpEventsInNamespace

func DumpEventsInNamespace(ctx context.Context, c kubernetes.Interface, namespace string)

func DumpNamespace added in v1.3.0

func DumpNamespace(ctx context.Context, discoveryClient discovery.DiscoveryInterface, dynamicClient dynamic.Interface, corev1Client corev1client.CoreV1Interface, artifactsDir string, name string) error

func DumpResource added in v1.3.0

func DumpResource(ctx context.Context, discoveryClient discovery.DiscoveryInterface, dynamicClient dynamic.Interface, corev1Client corev1client.CoreV1Interface, artifactsDir string, resourceInfo *collect.ResourceInfo, namespace string, name string) error

func Errorf

func Errorf(format string, args ...interface{})

func Failf

func Failf(format string, args ...interface{})

func FieldManager added in v1.13.0

func FieldManager(userAgent, namespace string) string

func Infof

func Infof(format string, args ...interface{})

func Skipf

func Skipf(format string, args ...interface{})

func WaitForObjectDeletion

func WaitForObjectDeletion(ctx context.Context, dynamicClient dynamic.Interface, resource schema.GroupVersionResource, namespace, name string, uid *types.UID) error

func WaitForServiceAccount

func WaitForServiceAccount(ctx context.Context, c corev1client.CoreV1Interface, namespace, name string) (*corev1.ServiceAccount, error)

func WaitForServiceAccountTokenSecret added in v1.9.0

func WaitForServiceAccountTokenSecret(ctx context.Context, c corev1client.CoreV1Interface, namespace, name string) (*corev1.Secret, error)

func Warnf

func Warnf(format string, args ...interface{})

Types

type AdminClient added in v1.13.0

type AdminClient struct {
	Config *restclient.Config
}

func (*AdminClient) AdminClientConfig added in v1.13.0

func (ac *AdminClient) AdminClientConfig() *restclient.Config

func (*AdminClient) DiscoveryClient added in v1.13.0

func (ac *AdminClient) DiscoveryClient() *discovery.DiscoveryClient

func (*AdminClient) DynamicAdminClient added in v1.13.0

func (ac *AdminClient) DynamicAdminClient() dynamic.Interface

func (*AdminClient) KubeAdminClient added in v1.13.0

func (ac *AdminClient) KubeAdminClient() *kubernetes.Clientset

func (*AdminClient) ScyllaAdminClient added in v1.13.0

func (ac *AdminClient) ScyllaAdminClient() *scyllaclientset.Clientset

type AdminClientInterface added in v1.13.0

type AdminClientInterface interface {
	GenericClientInterface
	AdminClientConfig() *restclient.Config
	KubeAdminClient() *kubernetes.Clientset
	DynamicAdminClient() dynamic.Interface
	ScyllaAdminClient() *scyllaclientset.Clientset
}

type CleanupInterface added in v1.14.0

type CleanupInterface interface {
	CollectToLog(ctx context.Context)
	Collect(ctx context.Context, artifactsDir string, ginkgoNamespace string)
	Cleanup(ctx context.Context)
}

type CleanupPolicyType added in v1.14.0

type CleanupPolicyType string
var (
	CleanupPolicyAlways    CleanupPolicyType = "Always"
	CleanupPolicyOnSuccess CleanupPolicyType = "OnSuccess"
	CleanupPolicyNever     CleanupPolicyType = "Never"
)

type Client added in v1.13.0

type Client struct {
	Config *restclient.Config
}

func CreateUserNamespace added in v1.13.0

func CreateUserNamespace(ctx context.Context, clusterName string, labels map[string]string, adminClient kubernetes.Interface, adminClientConfig *restclient.Config) (*corev1.Namespace, Client)

func (*Client) ClientConfig added in v1.13.0

func (c *Client) ClientConfig() *restclient.Config

func (*Client) DiscoveryClient added in v1.13.0

func (c *Client) DiscoveryClient() *discovery.DiscoveryClient

func (*Client) DynamicClient added in v1.13.0

func (c *Client) DynamicClient() dynamic.Interface

func (*Client) KubeClient added in v1.13.0

func (c *Client) KubeClient() *kubernetes.Clientset

func (*Client) ScyllaClient added in v1.13.0

func (c *Client) ScyllaClient() *scyllaclientset.Clientset

type ClientInterface added in v1.13.0

type ClientInterface interface {
	GenericClientInterface
	ClientConfig() *restclient.Config
	KubeClient() *kubernetes.Clientset
	DynamicClient() dynamic.Interface
	ScyllaClient() *scyllaclientset.Clientset
}

type Cluster added in v1.13.0

type Cluster struct {
	AdminClient
	// contains filtered or unexported fields
}

func NewCluster added in v1.13.0

func NewCluster(name string, artifactsDir string, restConfig *restclient.Config, createNamespace createNamespaceFunc) *Cluster

func (*Cluster) AddCleaners added in v1.14.0

func (c *Cluster) AddCleaners(cleaners ...CleanupInterface)

func (*Cluster) Cleanup added in v1.13.0

func (c *Cluster) Cleanup(ctx context.Context)

func (*Cluster) Collect added in v1.14.0

func (c *Cluster) Collect(ctx context.Context, ginkgoNamespace string)

func (*Cluster) CreateUserNamespace added in v1.13.0

func (c *Cluster) CreateUserNamespace(ctx context.Context) (*corev1.Namespace, Client)

func (*Cluster) DefaultNamespaceIfAny added in v1.13.0

func (c *Cluster) DefaultNamespaceIfAny() (*corev1.Namespace, Client, bool)

func (*Cluster) GetArtifactsDir added in v1.14.0

func (c *Cluster) GetArtifactsDir() string

type ClusterInterface added in v1.13.0

type ClusterInterface interface {
	AdminClientInterface
	DefaultNamespaceIfAny() (*corev1.Namespace, Client, bool)
	CreateUserNamespace(ctx context.Context) (*corev1.Namespace, Client)
}

type ExposeOptions added in v1.12.0

type ExposeOptions struct {
	NodeServiceType             scyllav1.NodeServiceType
	NodesBroadcastAddressType   scyllav1.BroadcastAddressType
	ClientsBroadcastAddressType scyllav1.BroadcastAddressType
}

type Framework

type Framework struct {
	FullClient
	// contains filtered or unexported fields
}

func NewFramework

func NewFramework(namePrefix string) *Framework

func (*Framework) AddCleaners added in v1.14.0

func (f *Framework) AddCleaners(cleaners ...CleanupInterface)

func (*Framework) Cluster added in v1.13.0

func (f *Framework) Cluster(idx int) ClusterInterface

func (*Framework) CommonLabels added in v1.9.0

func (f *Framework) CommonLabels() map[string]string

func (*Framework) CreateUserNamespace added in v1.13.0

func (f *Framework) CreateUserNamespace(ctx context.Context) (*corev1.Namespace, Client)

func (*Framework) DefaultNamespaceIfAny added in v1.13.0

func (f *Framework) DefaultNamespaceIfAny() (*corev1.Namespace, Client, bool)

func (*Framework) FieldManager added in v1.8.0

func (f *Framework) FieldManager() string

func (*Framework) GetDefaultArtifactsDir added in v1.14.0

func (f *Framework) GetDefaultArtifactsDir() string

func (*Framework) GetDefaultScyllaCluster added in v1.12.0

func (f *Framework) GetDefaultScyllaCluster() *scyllav1.ScyllaCluster

func (*Framework) GetDefaultZonalScyllaClusterWithThreeRacks added in v1.14.0

func (f *Framework) GetDefaultZonalScyllaClusterWithThreeRacks() *scyllav1.ScyllaCluster

func (*Framework) GetGCSServiceAccountKey added in v1.13.0

func (f *Framework) GetGCSServiceAccountKey() []byte

func (*Framework) GetIngressAddress added in v1.9.0

func (f *Framework) GetIngressAddress(hostname string) string

func (*Framework) GetObjectStorageBucket added in v1.13.0

func (f *Framework) GetObjectStorageBucket() string

func (*Framework) GetObjectStorageProvider added in v1.13.0

func (f *Framework) GetObjectStorageProvider() string

func (*Framework) GetObjectStorageType added in v1.13.0

func (f *Framework) GetObjectStorageType() ObjectStorageType

func (*Framework) GetS3CredentialsFile added in v1.14.0

func (f *Framework) GetS3CredentialsFile() []byte

func (*Framework) Namespace

func (f *Framework) Namespace() string

type FullClient added in v1.13.0

type FullClient struct {
	Client
	AdminClient
}

func (*FullClient) DiscoveryClient added in v1.13.0

func (c *FullClient) DiscoveryClient() *discovery.DiscoveryClient

type FullClientInterface added in v1.13.0

type FullClientInterface interface {
	ClientInterface
	AdminClientInterface
}

type GenericClientInterface added in v1.13.0

type GenericClientInterface interface {
	DiscoveryClient() *discovery.DiscoveryClient
}

type IngressController added in v1.11.0

type IngressController struct {
	IngressClassName  string
	Address           string
	CustomAnnotations map[string]string
}

type NamespaceCleaner added in v1.14.0

type NamespaceCleaner struct {
	Client        kubernetes.Interface
	DynamicClient dynamic.Interface
	NS            *corev1.Namespace
}

func (*NamespaceCleaner) Cleanup added in v1.14.0

func (nc *NamespaceCleaner) Cleanup(ctx context.Context)

func (*NamespaceCleaner) Collect added in v1.14.0

func (nc *NamespaceCleaner) Collect(ctx context.Context, artifactsDir string, _ string)

func (*NamespaceCleaner) CollectToLog added in v1.14.0

func (nc *NamespaceCleaner) CollectToLog(ctx context.Context)

type ObjectStorageType added in v1.13.0

type ObjectStorageType string
const (
	ObjectStorageTypeNone ObjectStorageType = "None"
	ObjectStorageTypeGCS  ObjectStorageType = "GCS"
	ObjectStorageTypeS3   ObjectStorageType = "S3"
)

type RestoreStrategy added in v1.14.0

type RestoreStrategy string
const (
	RestoreStrategyRecreate RestoreStrategy = "Recreate"
	RestoreStrategyUpdate   RestoreStrategy = "Update"
)

type RestoringCleaner added in v1.14.0

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

func NewRestoringCleaner added in v1.14.0

func NewRestoringCleaner(ctx context.Context, client kubernetes.Interface, dynamicClient dynamic.Interface, resourceInfo collect.ResourceInfo, namespace string, name string, strategy RestoreStrategy) *RestoringCleaner

func (*RestoringCleaner) Cleanup added in v1.14.0

func (rc *RestoringCleaner) Cleanup(ctx context.Context)

func (*RestoringCleaner) Collect added in v1.14.0

func (rc *RestoringCleaner) Collect(ctx context.Context, clusterArtifactsDir string, ginkgoNamespace string)

func (*RestoringCleaner) CollectToLog added in v1.14.0

func (rc *RestoringCleaner) CollectToLog(ctx context.Context)

func (*RestoringCleaner) DeleteObject added in v1.14.0

func (rc *RestoringCleaner) DeleteObject(ctx context.Context, ignoreNotFound bool)

type ScyllaClusterOptions added in v1.12.0

type ScyllaClusterOptions struct {
	ExposeOptions    ExposeOptions
	StorageClassName string
}

type TestContextType

type TestContextType struct {
	RestConfigs          []*restclient.Config
	ArtifactsDir         string
	CleanupPolicy        CleanupPolicyType
	IngressController    *IngressController
	ScyllaClusterOptions *ScyllaClusterOptions
	ObjectStorageType    ObjectStorageType
	ObjectStorageBucket  string
	GCSServiceAccountKey []byte
	S3CredentialsFile    []byte
}
var TestContext *TestContextType

Jump to

Keyboard shortcuts

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