framework

package
v1.19.2 Latest Latest
Warning

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

Go to latest
Published: Mar 19, 2026 License: Apache-2.0 Imports: 47 Imported by: 0

Documentation

Index

Constants

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

	RequiresObjectStorageLabelName    = "RequiresObjectStorage"
	NotSupportedOnOpenShiftLabelName  = "NotSupportedOnOpenShift"
	SupportedOnlyOnOpenShiftLabelName = "SupportedOnlyOnOpenShift"
)

Variables

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

	RequiresObjectStorage    = g.Label(RequiresObjectStorageLabelName)
	NotSupportedOnOpenShift  = g.Label(NotSupportedOnOpenShiftLabelName)
	SupportedOnlyOnOpenShift = g.Label(SupportedOnlyOnOpenShiftLabelName)
)

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, restConfig *rest.Config, 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, restConfig *rest.Config, 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) PrometheusOperatorAdminClient added in v1.19.0

func (ac *AdminClient) PrometheusOperatorAdminClient() *promclient.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
	PrometheusOperatorAdminClient() *promclient.Clientset
}

type Cleaner added in v1.17.0

type Cleaner interface {
	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 (*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 ...Cleaner)

func (*Cluster) AddCollectors added in v1.17.0

func (c *Cluster) AddCollectors(collectors ...Collector)

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

func (*Cluster) Name added in v1.18.0

func (c *Cluster) Name() string

type ClusterInterface added in v1.13.0

type ClusterInterface interface {
	AdminClientInterface
	Name() string
	DefaultNamespaceIfAny() (*corev1.Namespace, Client, bool)
	CreateUserNamespace(ctx context.Context) (*corev1.Namespace, Client)
	AddCleaners(cleaners ...Cleaner)
	AddCollectors(collectors ...Collector)
}

type ClusterObjectStorageSettings added in v1.18.0

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

ClusterObjectStorageSettings holds the object storage settings for a cluster.

func NewGCSClusterObjectStorageSettings added in v1.18.0

func NewGCSClusterObjectStorageSettings(bucketName string, serviceAccountKey []byte) (ClusterObjectStorageSettings, error)

NewGCSClusterObjectStorageSettings creates a new ClusterObjectStorageSettings for a cluster using a GCS bucket.

func NewS3ClusterObjectStorageSettings added in v1.18.0

func NewS3ClusterObjectStorageSettings(bucketName string, credentials []byte) (ClusterObjectStorageSettings, error)

NewS3ClusterObjectStorageSettings creates a new ClusterObjectStorageSettings for a cluster using an S3 bucket.

func (ClusterObjectStorageSettings) BucketName added in v1.18.0

func (s ClusterObjectStorageSettings) BucketName() string

BucketName returns the name of the object storage bucket.

func (ClusterObjectStorageSettings) GCSServiceAccountKey added in v1.18.0

func (s ClusterObjectStorageSettings) GCSServiceAccountKey() []byte

GCSServiceAccountKey returns the GCS service account key in JSON format. It's up to the caller to ensure that this is only called when Type is ObjectStorageTypeGCS.

func (ClusterObjectStorageSettings) S3CredentialsFile added in v1.18.0

func (s ClusterObjectStorageSettings) S3CredentialsFile() []byte

S3CredentialsFile returns the AWS credentials in JSON format. It's up to the caller to ensure that this is only called when Type is ObjectStorageTypeS3.

func (ClusterObjectStorageSettings) Type added in v1.18.0

Type returns the type of object storage used by the cluster.

type Collector added in v1.17.0

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

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 ...Cleaner)

func (*Framework) AddCollectors added in v1.17.0

func (f *Framework) AddCollectors(collectors ...Collector)

func (*Framework) Cluster added in v1.13.0

func (f *Framework) Cluster() 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) GetClusterObjectStorageSettings added in v1.18.0

func (f *Framework) GetClusterObjectStorageSettings() (ClusterObjectStorageSettings, bool)

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) GetDefaultScyllaDBCluster added in v1.16.0

func (f *Framework) GetDefaultScyllaDBCluster(rkcMap map[string]*scyllav1alpha1.RemoteKubernetesCluster) *scyllav1alpha1.ScyllaDBCluster

func (*Framework) GetDefaultScyllaDBDatacenter added in v1.15.0

func (f *Framework) GetDefaultScyllaDBDatacenter() *scyllav1alpha1.ScyllaDBDatacenter

func (*Framework) GetDefaultZonalScyllaClusterWithThreeRacks added in v1.14.0

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

func (*Framework) GetIngressAddress added in v1.9.0

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

func (*Framework) GetObjectStorageSettingsForWorkerCluster added in v1.18.0

func (f *Framework) GetObjectStorageSettingsForWorkerCluster(workerName string) ClusterObjectStorageSettings

func (*Framework) Name added in v1.18.0

func (f *Framework) Name() string

func (*Framework) Namespace

func (f *Framework) Namespace() string

func (*Framework) WorkerClusters added in v1.18.0

func (f *Framework) WorkerClusters() map[string]ClusterInterface

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 NamespaceCleanerCollector added in v1.17.0

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

func NewNamespaceCleanerCollector added in v1.17.0

func NewNamespaceCleanerCollector(restConfig *rest.Config, client kubernetes.Interface, dynamicClient dynamic.Interface, namespace *corev1.Namespace) *NamespaceCleanerCollector

func (NamespaceCleanerCollector) Cleanup added in v1.17.0

func (nc NamespaceCleanerCollector) Cleanup(ctx context.Context)

func (NamespaceCleanerCollector) Collect added in v1.17.0

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

func (NamespaceCleanerCollector) CollectToLog added in v1.17.0

func (nc NamespaceCleanerCollector) CollectToLog(ctx context.Context)

type NotFoundTolerantNamespaceCollector added in v1.18.0

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

func NewNotFoundTolerantNamespaceCollector added in v1.18.0

func NewNotFoundTolerantNamespaceCollector(restConfig *rest.Config, client kubernetes.Interface, dynamicClient dynamic.Interface, namespace string) *NotFoundTolerantNamespaceCollector

func (*NotFoundTolerantNamespaceCollector) Collect added in v1.18.0

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

func (NotFoundTolerantNamespaceCollector) CollectToLog added in v1.18.0

func (nc NotFoundTolerantNamespaceCollector) 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, restConfig *rest.Config, 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 {
	// RestConfig is the restclient.Config for the main cluster.
	// It also represents the "meta" or "control-plane" cluster in multi-datacenter setups.
	RestConfig *restclient.Config
	// WorkerRestConfigs contains a map of restclient.Configs for each worker cluster, keyed by the cluster identifier. Used in multi-datacenter setups.
	WorkerRestConfigs                  map[string]*restclient.Config
	ArtifactsDir                       string
	CleanupPolicy                      CleanupPolicyType
	IngressController                  *IngressController
	ScyllaClusterOptions               *ScyllaClusterOptions
	ScyllaDBVersion                    string
	ScyllaDBManagerVersion             string
	ScyllaDBManagerAgentVersion        string
	ScyllaDBUpdateFrom                 string
	ScyllaDBUpgradeFrom                string
	WorkerClusterObjectStorageSettings map[string]ClusterObjectStorageSettings
	ClusterObjectStorageSettings       *ClusterObjectStorageSettings
}
var TestContext *TestContextType

Jump to

Keyboard shortcuts

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