Documentation ¶
Index ¶
- Constants
- Variables
- func AddWorker(shoot *gardencorev1beta1.Shoot, cloudProfile *gardencorev1beta1.CloudProfile, ...) error
- func AddWorkerForName(shoot *gardencorev1beta1.Shoot, cloudProfile *gardencorev1beta1.CloudProfile, ...) error
- func ApplyFilters(event corev1.Event, filters ...EventFilterFunc) bool
- func CAfterEach(body func(context.Context), timeout time.Duration)
- func CAfterSuite(body func(context.Context), timeout time.Duration)
- func CBeforeEach(body func(ctx context.Context), timeout time.Duration)
- func CBeforeSuite(body func(context.Context), timeout time.Duration)
- func CIt(text string, body func(context.Context), timeout time.Duration)
- func CJustBeforeEach(body func(ctx context.Context), timeout time.Duration)
- func CommonAfterSuite()
- func CreateShootTestArtifacts(shootTestYamlPath string, prefix *string, ...) (string, *gardencorev1beta1.Shoot, error)
- func DeleteResource(ctx context.Context, k8sClient kubernetes.Interface, resource runtime.Object) error
- func DownloadKubeconfig(ctx context.Context, client kubernetes.Interface, ...) error
- func EnsureRepositoryDirectories(helm Helm) error
- func Exists(path string) (bool, error)
- func ExpectNoError(actual interface{}, extra ...interface{})
- func FCIt(text string, body func(context.Context), timeout time.Duration)
- func FileExists(kc string) bool
- func GetFirstRunningPodWithLabels(ctx context.Context, labelsMap labels.Selector, namespace string, ...) (*corev1.Pod, error)
- func GetObjectFromSecret(ctx context.Context, k8sClient kubernetes.Interface, ...) (string, error)
- func GetPodsByLabels(ctx context.Context, labelsSelector labels.Selector, c kubernetes.Interface, ...) (*corev1.PodList, error)
- func HTTPGet(ctx context.Context, url string) (*http.Response, error)
- func Must(err error)
- func NewClientFromServiceAccount(ctx context.Context, k8sClient kubernetes.Interface, ...) (kubernetes.Interface, error)
- func ParseFileAsProviderConfig(filepath string) (*gardencorev1beta1.ProviderConfig, error)
- func ParseFileAsWorkers(filepath string) ([]gardencorev1beta1.Worker, error)
- func PodExecByLabel(ctx context.Context, podLabels labels.Selector, ...) (io.Reader, error)
- func ReadObject(file string, into apimachineryRuntime.Object) error
- func RevertableSet(dst, src interface{}) (revert func())
- func Set(dst, src interface{})
- func SetProviderConfigsFromFilepath(shoot *gardencorev1beta1.Shoot, ...) error
- func SetupShootWorker(shoot *gardencorev1beta1.Shoot, cloudProfile *gardencorev1beta1.CloudProfile, ...) error
- func ShootCreationCompleted(newShoot *gardencorev1beta1.Shoot) bool
- func StringSet(s string) bool
- func TestHTTPEndpointWithBasicAuth(ctx context.Context, url, userName, password string) error
- func TestHTTPEndpointWithToken(ctx context.Context, url, token string) error
- func UpdateSecret(ctx context.Context, k8sClient kubernetes.Interface, secret *corev1.Secret) error
- type Chart
- type CommonConfig
- type CommonFramework
- func (f *CommonFramework) BeforeEach()
- func (f *CommonFramework) DeployChart(ctx context.Context, k8sClient kubernetes.Interface, ...) error
- func (f *CommonFramework) DownloadChartArtifacts(ctx context.Context, helm Helm, ...) error
- func (f *CommonFramework) RenderAndDeployChart(ctx context.Context, k8sClient kubernetes.Interface, c Chart, ...) error
- func (f *CommonFramework) RenderAndDeployTemplate(ctx context.Context, k8sClient kubernetes.Interface, templateName string, ...) error
- func (f *CommonFramework) WaitUntilDaemonSetIsRunning(ctx context.Context, k8sClient client.Client, ...) error
- func (f *CommonFramework) WaitUntilDeploymentsWithLabelsIsReady(ctx context.Context, deploymentLabels labels.Selector, namespace string, ...) error
- func (f *CommonFramework) WaitUntilNamespaceIsDeleted(ctx context.Context, k8sClient kubernetes.Interface, ns string) error
- func (f *CommonFramework) WaitUntilStatefulSetIsRunning(ctx context.Context, statefulSetName, statefulSetNamespace string, ...) error
- type EventFilterFunc
- type GardenerConfig
- type GardenerFramework
- func (f *GardenerFramework) AnnotateShoot(shoot *gardencorev1beta1.Shoot, annotations map[string]string) error
- func (f *GardenerFramework) BeforeEach()
- func (f *GardenerFramework) CreatePlant(ctx context.Context, plant *gardencorev1beta1.Plant) error
- func (f *GardenerFramework) CreatePlantSecret(ctx context.Context, namespace string, kubeConfigContent []byte) (*corev1.Secret, error)
- func (f *GardenerFramework) CreateShoot(ctx context.Context, shoot *gardencorev1beta1.Shoot) error
- func (f *GardenerFramework) DeletePlant(ctx context.Context, plant *gardencorev1beta1.Plant) error
- func (f *GardenerFramework) DeleteShoot(ctx context.Context, shoot *gardencorev1beta1.Shoot) error
- func (f *GardenerFramework) DeleteShootAndWaitForDeletion(ctx context.Context, shoot *gardencorev1beta1.Shoot) error
- func (f *GardenerFramework) DumpState(ctx context.Context)
- func (f *GardenerFramework) GetCloudProfile(ctx context.Context, name string) (*gardencorev1beta1.CloudProfile, error)
- func (f *GardenerFramework) GetSeed(ctx context.Context, seedName string, seedScheme *runtime.Scheme) (*gardencorev1beta1.Seed, kubernetes.Interface, error)
- func (f *GardenerFramework) GetShoot(ctx context.Context, shoot *gardencorev1beta1.Shoot) error
- func (f *GardenerFramework) GetShootProject(ctx context.Context, shootNamespace string) (*gardencorev1beta1.Project, error)
- func (f *GardenerFramework) HibernateShoot(ctx context.Context, shoot *gardencorev1beta1.Shoot) error
- func (f *GardenerFramework) MergePatchShoot(oldShoot, newShoot *gardencorev1beta1.Shoot) (*gardencorev1beta1.Shoot, error)
- func (f *GardenerFramework) NewShootFramework(shoot *gardencorev1beta1.Shoot) (*ShootFramework, error)
- func (f *GardenerFramework) RemoveShootAnnotation(shoot *gardencorev1beta1.Shoot, annotationKey string) error
- func (f *GardenerFramework) UpdateShoot(ctx context.Context, shoot *gardencorev1beta1.Shoot, ...) error
- func (f *GardenerFramework) WaitForPlantToBeCreated(ctx context.Context, plant *gardencorev1beta1.Plant) error
- func (f *GardenerFramework) WaitForPlantToBeDeleted(ctx context.Context, plant *gardencorev1beta1.Plant) error
- func (f *GardenerFramework) WaitForPlantToBeReconciledSuccessfully(ctx context.Context, plant *gardencorev1beta1.Plant) error
- func (f *GardenerFramework) WaitForPlantToBeReconciledWithUnknownStatus(ctx context.Context, plant *gardencorev1beta1.Plant) error
- func (f *GardenerFramework) WaitForShootToBeCreated(ctx context.Context, shoot *gardencorev1beta1.Shoot) error
- func (f *GardenerFramework) WaitForShootToBeDeleted(ctx context.Context, shoot *gardencorev1beta1.Shoot) error
- func (f *GardenerFramework) WaitForShootToBeReconciled(ctx context.Context, shoot *gardencorev1beta1.Shoot) error
- func (f *GardenerFramework) WakeUpShoot(ctx context.Context, shoot *gardencorev1beta1.Shoot) error
- type Helm
- type HelmAccess
- type SearchResponse
- type ShootConfig
- type ShootFramework
- func (f *ShootFramework) AddShoot(ctx context.Context, shootName, shootNamespace string) error
- func (f *ShootFramework) AfterEach(ctx context.Context)
- func (f *ShootFramework) BeforeEach()
- func (f *ShootFramework) CreateNewNamespace(ctx context.Context) (string, error)
- func (f *ShootFramework) DumpState(ctx context.Context)
- func (f *ShootFramework) GetCloudProfile(ctx context.Context) (*gardencorev1beta1.CloudProfile, error)
- func (f *ShootFramework) GetElasticsearchLogs(ctx context.Context, elasticsearchNamespace, podName string, ...) (*SearchResponse, error)
- func (f *ShootFramework) GetLoggingPassword(ctx context.Context) (string, error)
- func (f *ShootFramework) HibernateShoot(ctx context.Context) error
- func (f *ShootFramework) ShootKubeconfigSecretName() string
- func (f *ShootFramework) ShootSeedNamespace() string
- func (f *ShootFramework) UpdateShoot(ctx context.Context, update func(shoot *gardencorev1beta1.Shoot) error) error
- func (f *ShootFramework) WakeUpShoot(ctx context.Context) error
- type TestDescription
- func (t TestDescription) Beta() TestDescription
- func (t TestDescription) CIt(text string, body func(context.Context), timeout time.Duration)
- func (t TestDescription) Default() TestDescription
- func (t TestDescription) Disruptive() TestDescription
- func (t TestDescription) FCIt(text string, body func(context.Context), timeout time.Duration)
- func (t TestDescription) FIt(text string, body func())
- func (t TestDescription) It(text string, body func())
- func (t TestDescription) Release() TestDescription
- func (t TestDescription) Serial() TestDescription
- func (t TestDescription) String() string
Constants ¶
const ( // KubeconfigSecretKeyName ist the name of the key in a secret that holds the kubeconfig of a shoot KubeconfigSecretKeyName = "kubeconfig" // LoggingUserName is the admin user name for the elasticserach logging instance of a shoot LoggingUserName = "admin" // IntegrationTestPrefix is the default prefix that will be used for test shoots if none other is specified IntegrationTestPrefix = "itest-" // WorkerNamePrefix is the default prefix that will be used for Shoot workers WorkerNamePrefix = "worker-" )
Variables ¶
var ( // ErrNoRepositoriesFound no repositories found in repository file ErrNoRepositoriesFound = errors.New("no repositories found in repository file") // ErrNoInternalIPsForNodeWasFound no internal IPs were found for node ErrNoInternalIPsForNodeWasFound = errors.New("no internal IPs were found for node") // ErrNoRunningPodsFound no running pods were found ErrNoRunningPodsFound = errors.New("no running pods were found") )
Functions ¶
func AddWorker ¶
func AddWorker(shoot *gardencorev1beta1.Shoot, cloudProfile *gardencorev1beta1.CloudProfile, machineImage gardencorev1beta1.MachineImage, workerZone *string) error
AddWorker adds a valid default worker to the shoot for the given machineImage and CloudProfile.
func AddWorkerForName ¶
func AddWorkerForName(shoot *gardencorev1beta1.Shoot, cloudProfile *gardencorev1beta1.CloudProfile, machineImageName *string, workerZone *string) error
AddWorkerForName adds a valid worker to the shoot for the given machine image name. Returns an error if the machine image cannot be found in the CloudProfile.
func ApplyFilters ¶
func ApplyFilters(event corev1.Event, filters ...EventFilterFunc) bool
ApplyFilters checks if one of the EventFilters filters the current event
func CAfterEach ¶
CAfterEach contextifies Gingko's AfterEach
func CAfterSuite ¶
CAfterSuite contextifies Gingko's FIt
func CBeforeEach ¶
CBeforeEach contextifies Gingko's BeforeEach
func CBeforeSuite ¶
CBeforeSuite contextifies Gingko's FIt
func CJustBeforeEach ¶
CJustBeforeEach contextifies Gingko's JustBeforeEach
func CommonAfterSuite ¶
func CommonAfterSuite()
CommonAfterSuite performs necessary common steps after all tests of a suite a run
func CreateShootTestArtifacts ¶
func CreateShootTestArtifacts(shootTestYamlPath string, prefix *string, projectNamespace, shootRegion, cloudProfile, secretbinding, providerType, k8sVersion, externalDomain *string, clearDNS bool, clearExtensions bool) (string, *gardencorev1beta1.Shoot, error)
CreateShootTestArtifacts creates a shoot object from the given path and sets common attributes (test-individual settings like workers have to be handled by each test).
func DeleteResource ¶
func DeleteResource(ctx context.Context, k8sClient kubernetes.Interface, resource runtime.Object) error
DeleteResource deletes a kubernetes resource
func DownloadKubeconfig ¶
func DownloadKubeconfig(ctx context.Context, client kubernetes.Interface, namespace, name, downloadPath string) error
DownloadKubeconfig downloads the shoot Kubeconfig
func EnsureRepositoryDirectories ¶
EnsureRepositoryDirectories creates the repository directory which holds the repositories.yaml config file
func ExpectNoError ¶
func ExpectNoError(actual interface{}, extra ...interface{})
ExpectNoError checks if an error has occurred
func FileExists ¶
FileExists Checks if a file path exists and fail otherwise
func GetFirstRunningPodWithLabels ¶
func GetFirstRunningPodWithLabels(ctx context.Context, labelsMap labels.Selector, namespace string, client kubernetes.Interface) (*corev1.Pod, error)
GetFirstRunningPodWithLabels fetches the first running pod with the desired set of labels <labelsMap>
func GetObjectFromSecret ¶
func GetObjectFromSecret(ctx context.Context, k8sClient kubernetes.Interface, namespace, secretName, objectKey string) (string, error)
GetObjectFromSecret returns object from secret
func GetPodsByLabels ¶
func GetPodsByLabels(ctx context.Context, labelsSelector labels.Selector, c kubernetes.Interface, namespace string) (*corev1.PodList, error)
GetPodsByLabels fetches all pods with the desired set of labels <labelsMap>
func NewClientFromServiceAccount ¶
func NewClientFromServiceAccount(ctx context.Context, k8sClient kubernetes.Interface, account *corev1.ServiceAccount) (kubernetes.Interface, error)
NewClientFromServiceAccount returns a kubernetes client for a service account.
func ParseFileAsProviderConfig ¶
func ParseFileAsProviderConfig(filepath string) (*gardencorev1beta1.ProviderConfig, error)
ParseFileAsProviderConfig parses a file as a ProviderConfig
func ParseFileAsWorkers ¶
func ParseFileAsWorkers(filepath string) ([]gardencorev1beta1.Worker, error)
ParseFileAsWorkers parses a file as a Worker configuration
func PodExecByLabel ¶
func PodExecByLabel(ctx context.Context, podLabels labels.Selector, podContainer, command, namespace string, client kubernetes.Interface) (io.Reader, error)
PodExecByLabel executes a command inside pods filtered by label
func ReadObject ¶
func ReadObject(file string, into apimachineryRuntime.Object) error
ReadObject loads the contents of file and decodes it as an object.
func RevertableSet ¶
func RevertableSet(dst, src interface{}) (revert func())
RevertableSet sets the element of dst to src and returns a function that can revert back to the original values.
func Set ¶
func Set(dst, src interface{})
Set sets the pointer dst to the value of src.
dst has to be a pointer, src has to be assignable to the element type of dst.
func SetProviderConfigsFromFilepath ¶
func SetProviderConfigsFromFilepath(shoot *gardencorev1beta1.Shoot, infrastructureConfigPath, controlPlaneConfigPath, networkingConfigPath, workersConfigPath *string) error
SetProviderConfigsFromFilepath parses the infrastructure, controlPlane and networking provider-configs and sets them on the shoot
func SetupShootWorker ¶
func SetupShootWorker(shoot *gardencorev1beta1.Shoot, cloudProfile *gardencorev1beta1.CloudProfile, workerZone *string) error
SetupShootWorker prepares the Shoot with one worker with provider specific volume. Clears the currently configured workers.
func ShootCreationCompleted ¶
func ShootCreationCompleted(newShoot *gardencorev1beta1.Shoot) bool
ShootCreationCompleted checks if a shoot is successfully reconciled.
func TestHTTPEndpointWithBasicAuth ¶
TestHTTPEndpointWithBasicAuth validates that a http endpoint can be accessed using basic authentication
func TestHTTPEndpointWithToken ¶
TestHTTPEndpointWithToken validates that a http endpoint can be accessed using a bearer token
func UpdateSecret ¶
UpdateSecret updates the Secret with an backoff
Types ¶
type CommonConfig ¶
type CommonConfig struct { LogLevel string DisableStateDump bool ResourceDir string ChartDir string }
CommonConfig is the configuration for a common framework
func RegisterCommonFrameworkFlags ¶
func RegisterCommonFrameworkFlags(flagset *flag.FlagSet) *CommonConfig
RegisterCommonFrameworkFlags adds all flags that are needed to configure a common framework to the provided flagset.
type CommonFramework ¶
type CommonFramework struct { Config *CommonConfig Logger *logrus.Logger DisableStateDump bool // ResourcesDir is the absolute path to the resources directory ResourcesDir string // TemplatesDir is the absolute path to the templates directory TemplatesDir string // Chart is the absolute path to the helm chart directory ChartDir string }
CommonFramework represents the common gardener test framework that consolidates all shared features of the specific test frameworks (system, garderner, shoot)
func NewCommonFramework ¶
func NewCommonFramework(cfg *CommonConfig) *CommonFramework
NewCommonFramework creates a new common framework and registers its ginkgo BeforeEach setup
func (*CommonFramework) BeforeEach ¶
func (f *CommonFramework) BeforeEach()
BeforeEach should be called in ginkgo's BeforeEach. It sets up the common framework.
func (*CommonFramework) DeployChart ¶
func (f *CommonFramework) DeployChart(ctx context.Context, k8sClient kubernetes.Interface, namespace, chartRepoDestination, chartNameToDeploy string, values map[string]interface{}) error
DeployChart deploys it on the test cluster
func (*CommonFramework) DownloadChartArtifacts ¶
func (f *CommonFramework) DownloadChartArtifacts(ctx context.Context, helm Helm, chartRepoDestination, chartNameToDownload, chartVersionToDownload string) error
DownloadChartArtifacts downloads a helm chart from helm stable repo url available in resources/repositories
func (*CommonFramework) RenderAndDeployChart ¶
func (f *CommonFramework) RenderAndDeployChart(ctx context.Context, k8sClient kubernetes.Interface, c Chart, values map[string]interface{}) error
RenderAndDeployChart downloads a helm chart from helm stable repo url available in resources/repositories and deploys it on the test cluster
func (*CommonFramework) RenderAndDeployTemplate ¶
func (f *CommonFramework) RenderAndDeployTemplate(ctx context.Context, k8sClient kubernetes.Interface, templateName string, values interface{}) error
RenderAndDeployTemplate renders a template from the resource template directory and deploys it to the cluster
func (*CommonFramework) WaitUntilDaemonSetIsRunning ¶
func (f *CommonFramework) WaitUntilDaemonSetIsRunning(ctx context.Context, k8sClient client.Client, daemonSetName, daemonSetNamespace string) error
WaitUntilDaemonSetIsRunning waits until the daemon set with <daemonSetName> is running
func (*CommonFramework) WaitUntilDeploymentsWithLabelsIsReady ¶
func (f *CommonFramework) WaitUntilDeploymentsWithLabelsIsReady(ctx context.Context, deploymentLabels labels.Selector, namespace string, k8sClient kubernetes.Interface) error
WaitUntilDeploymentsWithLabelsIsReady wait until pod with labels <podLabels> is running
func (*CommonFramework) WaitUntilNamespaceIsDeleted ¶
func (f *CommonFramework) WaitUntilNamespaceIsDeleted(ctx context.Context, k8sClient kubernetes.Interface, ns string) error
WaitUntilNamespaceIsDeleted waits until a namespace has been deleted
func (*CommonFramework) WaitUntilStatefulSetIsRunning ¶
func (f *CommonFramework) WaitUntilStatefulSetIsRunning(ctx context.Context, statefulSetName, statefulSetNamespace string, c kubernetes.Interface) error
WaitUntilStatefulSetIsRunning waits until the stateful set with <statefulSetName> is running
type EventFilterFunc ¶
EventFilterFunc is a function to filter events
type GardenerConfig ¶
type GardenerConfig struct { CommonConfig *CommonConfig GardenerKubeconfig string ProjectNamespace string }
GardenerConfig is the configuration for a gardener framework
func RegisterGardenerFrameworkFlags ¶
func RegisterGardenerFrameworkFlags(flagset *flag.FlagSet) *GardenerConfig
RegisterGardenerFrameworkFlags adds all flags that are needed to configure a gardener framework to the provided flagset.
type GardenerFramework ¶
type GardenerFramework struct { *CommonFramework TestDescription GardenClient kubernetes.Interface ProjectNamespace string GardenerFrameworkConfig *GardenerConfig }
GardenerFramework is the gardener test framework that includes functions for working with a gardener instance
func NewGardenerFramework ¶
func NewGardenerFramework(cfg *GardenerConfig) *GardenerFramework
NewGardenerFramework creates a new gardener test framework. All needed flags are parsed during before each suite.
func NewGardenerFrameworkFromConfig ¶
func NewGardenerFrameworkFromConfig(cfg *GardenerConfig) *GardenerFramework
NewGardenerFrameworkFromConfig creates a new gardener test framework without registering ginkgo specific functions
func (*GardenerFramework) AnnotateShoot ¶
func (f *GardenerFramework) AnnotateShoot(shoot *gardencorev1beta1.Shoot, annotations map[string]string) error
AnnotateShoot adds shoot annotation(s)
func (*GardenerFramework) BeforeEach ¶
func (f *GardenerFramework) BeforeEach()
BeforeEach should be called in ginkgo's BeforeEach. It sets up the gardener framework.
func (*GardenerFramework) CreatePlant ¶
func (f *GardenerFramework) CreatePlant(ctx context.Context, plant *gardencorev1beta1.Plant) error
CreatePlant Creates a plant from a plant Object
func (*GardenerFramework) CreatePlantSecret ¶
func (f *GardenerFramework) CreatePlantSecret(ctx context.Context, namespace string, kubeConfigContent []byte) (*corev1.Secret, error)
CreatePlantSecret creates a new Secret for the Plant
func (*GardenerFramework) CreateShoot ¶
func (f *GardenerFramework) CreateShoot(ctx context.Context, shoot *gardencorev1beta1.Shoot) error
CreateShoot Creates a shoot from a shoot Object and waits until it is successfully reconciled
func (*GardenerFramework) DeletePlant ¶
func (f *GardenerFramework) DeletePlant(ctx context.Context, plant *gardencorev1beta1.Plant) error
DeletePlant deletes the test plant
func (*GardenerFramework) DeleteShoot ¶
func (f *GardenerFramework) DeleteShoot(ctx context.Context, shoot *gardencorev1beta1.Shoot) error
DeleteShoot deletes the test shoot
func (*GardenerFramework) DeleteShootAndWaitForDeletion ¶
func (f *GardenerFramework) DeleteShootAndWaitForDeletion(ctx context.Context, shoot *gardencorev1beta1.Shoot) error
DeleteShootAndWaitForDeletion deletes the test shoot and waits until it cannot be found any more
func (*GardenerFramework) DumpState ¶
func (f *GardenerFramework) DumpState(ctx context.Context)
DumpState greps all necessary logs and state of the cluster if the test failed TODO: dump extension controller namespaces TODO: dump logs of gardener extension controllers and other system components
func (*GardenerFramework) GetCloudProfile ¶
func (f *GardenerFramework) GetCloudProfile(ctx context.Context, name string) (*gardencorev1beta1.CloudProfile, error)
GetCloudProfile returns the cloudprofile from gardener with the give name
func (*GardenerFramework) GetSeed ¶
func (f *GardenerFramework) GetSeed(ctx context.Context, seedName string, seedScheme *runtime.Scheme) (*gardencorev1beta1.Seed, kubernetes.Interface, error)
GetSeed returns the seed and its k8s client
func (*GardenerFramework) GetShoot ¶
func (f *GardenerFramework) GetShoot(ctx context.Context, shoot *gardencorev1beta1.Shoot) error
GetShoot gets the test shoot
func (*GardenerFramework) GetShootProject ¶
func (f *GardenerFramework) GetShootProject(ctx context.Context, shootNamespace string) (*gardencorev1beta1.Project, error)
GetShootProject returns the project of a shoot
func (*GardenerFramework) HibernateShoot ¶
func (f *GardenerFramework) HibernateShoot(ctx context.Context, shoot *gardencorev1beta1.Shoot) error
HibernateShoot hibernates the test shoot
func (*GardenerFramework) MergePatchShoot ¶
func (f *GardenerFramework) MergePatchShoot(oldShoot, newShoot *gardencorev1beta1.Shoot) (*gardencorev1beta1.Shoot, error)
MergePatchShoot performs a two way merge patch operation on a shoot object
func (*GardenerFramework) NewShootFramework ¶
func (f *GardenerFramework) NewShootFramework(shoot *gardencorev1beta1.Shoot) (*ShootFramework, error)
NewShootFramework creates a new shoot framework with the current gardener framework and a shoot
func (*GardenerFramework) RemoveShootAnnotation ¶
func (f *GardenerFramework) RemoveShootAnnotation(shoot *gardencorev1beta1.Shoot, annotationKey string) error
RemoveShootAnnotation removes an annotation with key <annotationKey> from a shoot object
func (*GardenerFramework) UpdateShoot ¶
func (f *GardenerFramework) UpdateShoot(ctx context.Context, shoot *gardencorev1beta1.Shoot, update func(shoot *gardencorev1beta1.Shoot) error) error
UpdateShoot Updates a shoot from a shoot Object and waits for its reconciliation
func (*GardenerFramework) WaitForPlantToBeCreated ¶
func (f *GardenerFramework) WaitForPlantToBeCreated(ctx context.Context, plant *gardencorev1beta1.Plant) error
WaitForPlantToBeCreated waits for the plant to be created
func (*GardenerFramework) WaitForPlantToBeDeleted ¶
func (f *GardenerFramework) WaitForPlantToBeDeleted(ctx context.Context, plant *gardencorev1beta1.Plant) error
WaitForPlantToBeDeleted waits for the plant to be deleted
func (*GardenerFramework) WaitForPlantToBeReconciledSuccessfully ¶
func (f *GardenerFramework) WaitForPlantToBeReconciledSuccessfully(ctx context.Context, plant *gardencorev1beta1.Plant) error
WaitForPlantToBeReconciledSuccessfully waits for the plant to be reconciled with a status indicating success
func (*GardenerFramework) WaitForPlantToBeReconciledWithUnknownStatus ¶
func (f *GardenerFramework) WaitForPlantToBeReconciledWithUnknownStatus(ctx context.Context, plant *gardencorev1beta1.Plant) error
WaitForPlantToBeReconciledWithUnknownStatus waits for the plant to be reconciled, setting the expected status 'unknown'
func (*GardenerFramework) WaitForShootToBeCreated ¶
func (f *GardenerFramework) WaitForShootToBeCreated(ctx context.Context, shoot *gardencorev1beta1.Shoot) error
WaitForShootToBeCreated waits for the shoot to be created
func (*GardenerFramework) WaitForShootToBeDeleted ¶
func (f *GardenerFramework) WaitForShootToBeDeleted(ctx context.Context, shoot *gardencorev1beta1.Shoot) error
WaitForShootToBeDeleted waits for the shoot to be deleted
func (*GardenerFramework) WaitForShootToBeReconciled ¶
func (f *GardenerFramework) WaitForShootToBeReconciled(ctx context.Context, shoot *gardencorev1beta1.Shoot) error
WaitForShootToBeReconciled waits for the shoot to be successfully reconciled
func (*GardenerFramework) WakeUpShoot ¶
func (f *GardenerFramework) WakeUpShoot(ctx context.Context, shoot *gardencorev1beta1.Shoot) error
WakeUpShoot wakes up the test shoot from hibernation
type Helm ¶
type Helm string
Helm is the home for the HELM repo
func (Helm) CacheIndex ¶
CacheIndex returns the path to an index for the given named repository.
func (Helm) Repository ¶
Repository returns the path to the local repository.
func (Helm) RepositoryFile ¶
RepositoryFile returns the path to the repositories.yaml file.
type HelmAccess ¶
type HelmAccess struct {
HelmPath Helm
}
HelmAccess is a struct that holds the helm home
type SearchResponse ¶
type SearchResponse struct { Hits struct { Total uint64 `json:"total"` } `json:"hits"` }
SearchResponse represents the response from a search query to elasticsearch
type ShootConfig ¶
type ShootConfig struct { GardenerConfig *GardenerConfig ShootName string Fenced bool SeedScheme *runtime.Scheme CreateTestNamespace bool DisableTestNamespaceCleanup bool }
ShootConfig is the configuration for a shoot framework
func RegisterShootFrameworkFlags ¶
func RegisterShootFrameworkFlags(flagset *flag.FlagSet) *ShootConfig
RegisterShootFrameworkFlags adds all flags that are needed to configure a shoot framework to the provided flagset.
type ShootFramework ¶
type ShootFramework struct { *GardenerFramework TestDescription Config *ShootConfig SeedClient kubernetes.Interface ShootClient kubernetes.Interface Seed *gardencorev1beta1.Seed CloudProfile *gardencorev1beta1.CloudProfile Shoot *gardencorev1beta1.Shoot Project *gardencorev1beta1.Project Namespace string }
ShootFramework represents the shoot test framework that includes test functions that can be executed ona specific shoot
func NewShootFramework ¶
func NewShootFramework(cfg *ShootConfig) *ShootFramework
NewShootFramework creates a new simple Shoot framework
func NewShootFrameworkFromConfig ¶
func NewShootFrameworkFromConfig(cfg *ShootConfig) (*ShootFramework, error)
NewShootFrameworkFromConfig creates a new Shoot framework from a shoot configuration
func (*ShootFramework) AddShoot ¶
func (f *ShootFramework) AddShoot(ctx context.Context, shootName, shootNamespace string) error
AddShoot sets the shoot and its seed for the GardenerOperation.
func (*ShootFramework) AfterEach ¶
func (f *ShootFramework) AfterEach(ctx context.Context)
AfterEach should be called in ginkgo's AfterEach. Cleans up resources and dumps the shoot state if the test failed
func (*ShootFramework) BeforeEach ¶
func (f *ShootFramework) BeforeEach()
BeforeEach should be called in ginkgo's BeforeEach. It sets up the shoot framework.
func (*ShootFramework) CreateNewNamespace ¶
func (f *ShootFramework) CreateNewNamespace(ctx context.Context) (string, error)
CreateNewNamespace creates a new namespace with a generated name prefixed with "gardener-e2e-". The created namespace is automatically cleaned up when the test is finished.
func (*ShootFramework) DumpState ¶
func (f *ShootFramework) DumpState(ctx context.Context)
DumpState dumps the state of a shoot The state includes all k8s components running in the shoot itself as well as the controlplane
func (*ShootFramework) GetCloudProfile ¶
func (f *ShootFramework) GetCloudProfile(ctx context.Context) (*gardencorev1beta1.CloudProfile, error)
GetCloudProfile returns the cloudprofile of the shoot
func (*ShootFramework) GetElasticsearchLogs ¶
func (f *ShootFramework) GetElasticsearchLogs(ctx context.Context, elasticsearchNamespace, podName string, client kubernetes.Interface) (*SearchResponse, error)
GetElasticsearchLogs gets logs for <podName> from the elasticsearch instance in <elasticsearchNamespace>
func (*ShootFramework) GetLoggingPassword ¶
func (f *ShootFramework) GetLoggingPassword(ctx context.Context) (string, error)
GetLoggingPassword returns the passwort to access the elasticseerach logging instance
func (*ShootFramework) HibernateShoot ¶
func (f *ShootFramework) HibernateShoot(ctx context.Context) error
HibernateShoot hibernates the shoot of the framework
func (*ShootFramework) ShootKubeconfigSecretName ¶
func (f *ShootFramework) ShootKubeconfigSecretName() string
ShootKubeconfigSecretName gets the name of the secret with the kubeconfig of the shoot
func (*ShootFramework) ShootSeedNamespace ¶
func (f *ShootFramework) ShootSeedNamespace() string
ShootSeedNamespace gets the shoot namespace in the seed
func (*ShootFramework) UpdateShoot ¶
func (f *ShootFramework) UpdateShoot(ctx context.Context, update func(shoot *gardencorev1beta1.Shoot) error) error
UpdateShoot Updates a shoot from a shoot Object and waits for its reconciliation
func (*ShootFramework) WakeUpShoot ¶
func (f *ShootFramework) WakeUpShoot(ctx context.Context) error
WakeUpShoot wakes up the hibernated shoot of the framework
type TestDescription ¶
type TestDescription struct {
// contains filtered or unexported fields
}
TestDescription labels tests according to the provided labels in the expected order.
func NewTestDescription ¶
func NewTestDescription(baseLabel string) TestDescription
NewTestDescription creates a new test description
func (TestDescription) Beta ¶
func (t TestDescription) Beta() TestDescription
Beta labels a test as beta test
func (TestDescription) CIt ¶
CIt defines a contextified ginkgo It block and enhances the test description with the provided labels
func (TestDescription) Default ¶
func (t TestDescription) Default() TestDescription
Default labels a test as default test
func (TestDescription) Disruptive ¶
func (t TestDescription) Disruptive() TestDescription
Disruptive labels a test as disruptive. Tis kind of test should not run on a productive landscape.
func (TestDescription) FCIt ¶
FCIt defines a contextified ginkgo FIt block and enhances the test description with the provided labels
func (TestDescription) FIt ¶
func (t TestDescription) FIt(text string, body func())
FIt defines a ginkgo FIt block and enhances the test description with the provided labels
func (TestDescription) It ¶
func (t TestDescription) It(text string, body func())
It defines a ginkgo It block and enhances the test description with the provided labels
func (TestDescription) Release ¶
func (t TestDescription) Release() TestDescription
Release labels a test as release relevant test
func (TestDescription) Serial ¶
func (t TestDescription) Serial() TestDescription
Serial labels a test to be run as serial step
func (TestDescription) String ¶
func (t TestDescription) String() string
String returns the test description labels