e2e

package
v0.13.2 Latest Latest
Warning

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

Go to latest
Published: Apr 12, 2024 License: Apache-2.0 Imports: 44 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Tester

type Tester struct {
	HubKubeClient         kubernetes.Interface
	SpokeKubeClient       kubernetes.Interface
	HubAPIExtensionClient apiextensionsclient.Interface
	HubClusterCfg         *rest.Config
	SpokeClusterCfg       *rest.Config
	OperatorClient        operatorclient.Interface
	ClusterClient         clusterclient.Interface
	HubWorkClient         workv1client.Interface
	SpokeWorkClient       workv1client.Interface
	AddOnClinet           addonclient.Interface

	HubDynamicClient   dynamic.Interface
	SpokeDynamicClient dynamic.Interface

	EventuallyTimeout  time.Duration
	EventuallyInterval time.Duration
	// contains filtered or unexported fields
}

func NewTester

func NewTester(hubKubeConfigPath, spokeKubeConfigPath, registrationImage, workImage, singletonImage string, timeout time.Duration) *Tester

kubeconfigPath is the path of kubeconfig file, will be get from env "KUBECONFIG" by default. bootstrapHubSecret is the bootstrap hub kubeconfig secret, and the format is "namespace/secretName". Default of bootstrapHubSecret is helpers.KlusterletDefaultNamespace/helpers.BootstrapHubKubeConfig.

func (*Tester) AcceptsClient

func (t *Tester) AcceptsClient(clusterName string) error

func (*Tester) ApproveCSR

func (t *Tester) ApproveCSR(clusterName string) error

func (*Tester) BuildClusterClient

func (t *Tester) BuildClusterClient(saNamespace, saName string, clusterPolicyRules, policyRules []rbacv1.PolicyRule) (clusterclient.Interface, error)

func (*Tester) CheckHubReady

func (t *Tester) CheckHubReady() error

func (*Tester) CheckKlusterletOperatorReady

func (t *Tester) CheckKlusterletOperatorReady() error

func (*Tester) CheckManagedClusterAddOnStatus

func (t *Tester) CheckManagedClusterAddOnStatus(managedClusterNamespace, addOnName string) error

func (*Tester) CheckManagedClusterStatus

func (t *Tester) CheckManagedClusterStatus(clusterName string) error

func (*Tester) CleanupClusterClient

func (t *Tester) CleanupClusterClient(saNamespace, saName string) error

cleanupClusterClient delete cluster-scope resource created by func "buildClusterClient", the namespace-scope resources should be deleted by an additional namespace deleting func. It is recommended be invoked as a pair with the func "buildClusterClient"

func (*Tester) CreateApprovedKlusterlet

func (t *Tester) CreateApprovedKlusterlet(name, clusterName, klusterletNamespace string, mode operatorapiv1.InstallMode) (*operatorapiv1.Klusterlet, error)

func (*Tester) CreateFakeExternalKubeconfigSecret

func (t *Tester) CreateFakeExternalKubeconfigSecret(klusterlet *operatorapiv1.Klusterlet) error

func (*Tester) CreateKlusterlet

func (t *Tester) CreateKlusterlet(name, clusterName, klusterletNamespace string, mode operatorapiv1.InstallMode) (*operatorapiv1.Klusterlet, error)

func (*Tester) CreateManagedClusterAddOn

func (t *Tester) CreateManagedClusterAddOn(managedClusterNamespace, addOnName, installNamespace string) error

func (*Tester) CreateManagedClusterAddOnLease

func (t *Tester) CreateManagedClusterAddOnLease(addOnInstallNamespace, addOnName string) error

func (*Tester) CreatePureHostedKlusterlet

func (t *Tester) CreatePureHostedKlusterlet(name, clusterName string) (*operatorapiv1.Klusterlet, error)

func (*Tester) CreateWorkOfConfigMap

func (t *Tester) CreateWorkOfConfigMap(name, clusterName, configMapName, configMapNamespace string) (*workapiv1.ManifestWork, error)

func (*Tester) DeleteExternalKubeconfigSecret

func (t *Tester) DeleteExternalKubeconfigSecret(klusterlet *operatorapiv1.Klusterlet) error

func (*Tester) DeleteManageClusterAndRelatedNamespace

func (t *Tester) DeleteManageClusterAndRelatedNamespace(clusterName string) error

func (*Tester) EnableWorkFeature

func (t *Tester) EnableWorkFeature(feature string) error

func (*Tester) GetCreatedManagedCluster

func (t *Tester) GetCreatedManagedCluster(clusterName string) (*clusterv1.ManagedCluster, error)

func (*Tester) GetRandomClusterName

func (t *Tester) GetRandomClusterName() (string, error)

GetRandomClusterName gets the clusterName generated by registration randomly. the cluster name is the random name if it has not prefix "e2e-". TODO: get random cluster name from event

func (*Tester) Init

func (t *Tester) Init() error

func (*Tester) OutputDebugLogs

func (t *Tester) OutputDebugLogs()

TODO: only output the details of created resources during e2e

func (*Tester) RemoveWorkFeature

func (t *Tester) RemoveWorkFeature(feature string) error

func (*Tester) SetBootstrapHubSecret

func (t *Tester) SetBootstrapHubSecret(bootstrapHubSecret string) error

func (*Tester) SetEventuallyInterval

func (t *Tester) SetEventuallyInterval(timeout time.Duration) *Tester

func (*Tester) SetEventuallyTimeout

func (t *Tester) SetEventuallyTimeout(timeout time.Duration) *Tester

func (*Tester) SetOperatorNamespace

func (t *Tester) SetOperatorNamespace(ns string) *Tester

func (*Tester) SpokePodLog

func (t *Tester) SpokePodLog(podName, nameSpace string, lines int64) (string, error)

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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