Documentation
¶
Overview ¶
Deprecated: this is the deprecated gardener testframework. Use gardener/test/framework instead
Deprecated: this is the deprecated gardener testframework. Use gardener/test/framework instead
Deprecated: this is the deprecated gardener testframework. Use gardener/test/framework instead
Deprecated: this is the deprecated gardener testframework. Use gardener/test/framework instead
Deprecated: this is the deprecated gardener testframework. Use gardener/test/framework instead
Deprecated: this is the deprecated gardener testframework. Use gardener/test/framework instead
Deprecated: this is the deprecated gardener testframework. Use gardener/test/framework instead
Deprecated: this is the deprecated gardener testframework. Use gardener/test/framework instead
Deprecated: this is the deprecated gardener testframework. Use gardener/test/framework instead
Deprecated: this is the deprecated gardener testframework. Use gardener/test/framework instead
Deprecated: this is the deprecated gardener testframework. Use gardener/test/framework instead
Deprecated: this is the deprecated gardener testframework. Use gardener/test/framework instead
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 ChooseRegionAndZoneWithNoSeed(regions []gardencorev1beta1.Region, seeds []gardencorev1beta1.Seed) (*gardencorev1beta1.Region, error)
- func CreatePlantTestArtifacts(plantTestYamlPath string) (*gardencorev1beta1.Plant, error)
- func CreateShootTestArtifacts(shootTestYamlPath string, prefix *string, ...) (string, *gardencorev1beta1.Shoot, error)
- func EnsureDirectories(helm Helm) error
- func Exists(path string) (bool, error)
- func GetDeploymentReplicas(ctx context.Context, client client.Client, namespace, name string) (*int32, error)
- func GetObjectFromSecret(ctx context.Context, k8sClient kubernetes.Interface, ...) (string, error)
- func GetProjectRootPath() string
- 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 ReadObject(file string, into apimachineryRuntime.Object) error
- func ScaleDeployment(setupContextTimeout time.Duration, client client.Client, ...) (*int32, error)
- func ScaleGardenerControllerManager(setupContextTimeout time.Duration, client client.Client, ...) (*int32, error)
- func ScaleGardenerScheduler(setupContextTimeout time.Duration, client client.Client, ...) (*int32, error)
- func SetProviderConfigsFromFilepath(shoot *gardencorev1beta1.Shoot, ...) error
- func ShootCreationCompleted(newShoot *gardencorev1beta1.Shoot) bool
- func WaitUntilDeploymentScaled(ctx context.Context, client client.Client, namespace, name string, ...) error
- type EventFilterFunc
- type GardenerTestOperation
- func (o *GardenerTestOperation) AddShoot(ctx context.Context, shoot *gardencorev1beta1.Shoot) error
- func (o *GardenerTestOperation) AfterEach(ctx context.Context)
- func (o *GardenerTestOperation) DashboardAvailable(ctx context.Context) error
- func (o *GardenerTestOperation) DeployChart(ctx context.Context, namespace, chartRepoDestination, chartNameToDeploy string, ...) error
- func (o *GardenerTestOperation) DownloadChartArtifacts(ctx context.Context, helm Helm, ...) error
- func (o *GardenerTestOperation) DownloadKubeconfig(ctx context.Context, client kubernetes.Interface, ...) error
- func (o *GardenerTestOperation) DumpState(ctx context.Context)
- func (o *GardenerTestOperation) GetDashboardPodIP(ctx context.Context) (string, error)
- func (o *GardenerTestOperation) GetElasticsearchLogs(ctx context.Context, elasticsearchNamespace, podName string, ...) (*SearchResponse, error)
- func (o *GardenerTestOperation) GetFirstRunningPodWithLabels(ctx context.Context, labelsMap labels.Selector, namespace string, ...) (*corev1.Pod, error)
- func (o *GardenerTestOperation) GetPodsByLabels(ctx context.Context, labelsSelector labels.Selector, c kubernetes.Interface, ...) (*corev1.PodList, error)
- func (o *GardenerTestOperation) HTTPGet(ctx context.Context, url string) (*http.Response, error)
- func (o *GardenerTestOperation) KibanaDashboardAvailable(ctx context.Context) error
- func (o *GardenerTestOperation) PodExecByLabel(ctx context.Context, podLabels labels.Selector, ...) (io.Reader, error)
- func (o *GardenerTestOperation) ShootSeedNamespace() string
- func (o *GardenerTestOperation) WaitUntilDaemonSetIsRunning(ctx context.Context, daemonSetName, daemonSetNamespace string, ...) error
- func (o *GardenerTestOperation) WaitUntilDeploymentIsRunning(ctx context.Context, deploymentName, deploymentNamespace string, ...) error
- func (o *GardenerTestOperation) WaitUntilDeploymentsWithLabelsIsReady(ctx context.Context, deploymentLabels labels.Selector, namespace string, ...) error
- func (o *GardenerTestOperation) WaitUntilElasticsearchReceivesLogs(ctx context.Context, elasticsearchNamespace, podName string, expected uint64, ...) error
- func (o *GardenerTestOperation) WaitUntilGuestbookAppIsAvailable(ctx context.Context, guestbookAppUrls []string) error
- func (o *GardenerTestOperation) WaitUntilPodIsRunning(ctx context.Context, podName, podNamespace string, c kubernetes.Interface) error
- func (o *GardenerTestOperation) WaitUntilPodIsRunningWithLabels(ctx context.Context, labels labels.Selector, podNamespace string, ...) error
- func (o *GardenerTestOperation) WaitUntilStatefulSetIsRunning(ctx context.Context, statefulSetName, statefulSetNamespace string, ...) error
- type Helm
- type HelmAccess
- type PlantTest
- func (s *PlantTest) CreatePlant(ctx context.Context, secret *corev1.Secret) error
- func (s *PlantTest) CreatePlantSecret(ctx context.Context, kubeConfigContent []byte) (*corev1.Secret, error)
- func (s *PlantTest) DeletePlant(ctx context.Context) error
- func (s *PlantTest) GetPlant(ctx context.Context) (*gardencorev1beta1.Plant, error)
- func (s *PlantTest) GetPlantSecret(ctx context.Context) (*corev1.Secret, error)
- func (s *PlantTest) UpdatePlantSecret(ctx context.Context, updatedPlantSecret *corev1.Secret) error
- func (s *PlantTest) WaitForPlantToBeCreated(ctx context.Context) error
- func (s *PlantTest) WaitForPlantToBeDeleted(ctx context.Context) error
- func (s *PlantTest) WaitForPlantToBeReconciledSuccessfully(ctx context.Context) error
- func (s *PlantTest) WaitForPlantToBeReconciledWithUnknownStatus(ctx context.Context) error
- type SchedulerGardenerTest
- func (s *SchedulerGardenerTest) ChooseRegionAndZoneWithNoSeed() (*gardencorev1beta1.Region, error)
- func (s *SchedulerGardenerTest) ChooseSeedWhereTestShootIsNotDeployed(shoot *gardencorev1beta1.Shoot) (*gardencorev1beta1.Seed, error)
- func (s *SchedulerGardenerTest) CreateShoot(ctx context.Context) (*gardencorev1beta1.Shoot, error)
- func (s *SchedulerGardenerTest) GenerateInvalidSeed() (*gardencorev1beta1.Seed, error)
- func (s *SchedulerGardenerTest) GenerateInvalidShoot() (*gardencorev1beta1.Shoot, error)
- func (s *SchedulerGardenerTest) ScheduleShoot(ctx context.Context, shoot *gardencorev1beta1.Shoot, ...) error
- func (s *SchedulerGardenerTest) WaitForShootToBeScheduled(ctx context.Context) error
- func (s *SchedulerGardenerTest) WaitForShootToBeUnschedulable(ctx context.Context) error
- type SearchResponse
- type ShootGardenerTest
- func (s *ShootGardenerTest) AnnotateShoot(ctx context.Context, annotations map[string]string) error
- func (s *ShootGardenerTest) CreateShoot(ctx context.Context) (*gardencorev1beta1.Shoot, error)
- func (s *ShootGardenerTest) CreateShootResource(ctx context.Context, shootToCreate *gardencorev1beta1.Shoot) (*gardencorev1beta1.Shoot, error)
- func (s *ShootGardenerTest) DeleteShoot(ctx context.Context) error
- func (s *ShootGardenerTest) DeleteShootAndWaitForDeletion(ctx context.Context) error
- func (s *ShootGardenerTest) GetShoot(ctx context.Context) (*gardencorev1beta1.Shoot, error)
- func (s *ShootGardenerTest) HibernateShoot(ctx context.Context) error
- func (s *ShootGardenerTest) RemoveShootAnnotation(ctx context.Context, annotationKey string) error
- func (s *ShootGardenerTest) SetupShootWorker(workerZone *string) error
- func (s *ShootGardenerTest) UpdateShoot(ctx context.Context, shoot *gardencorev1beta1.Shoot, update UpdateShootFunc) (*gardencorev1beta1.Shoot, error)
- func (s *ShootGardenerTest) WaitForShootToBeCreated(ctx context.Context) error
- func (s *ShootGardenerTest) WaitForShootToBeDeleted(ctx context.Context) error
- func (s *ShootGardenerTest) WaitForShootToBeReconciled(ctx context.Context) error
- func (s *ShootGardenerTest) WakeUpShoot(ctx context.Context) error
- type ShootMaintenanceTest
- func (s *ShootMaintenanceTest) CleanupCloudProfile(ctx context.Context, testMachineImage gardencorev1beta1.ShootMachineImage, ...) error
- func (s *ShootMaintenanceTest) CreateShoot(ctx context.Context) (*gardencorev1beta1.Shoot, error)
- func (s *ShootMaintenanceTest) TryUpdateCloudProfileForKubernetesVersionMaintenance(ctx context.Context, shoot *gardencorev1beta1.Shoot, targetVersion string, ...) error
- func (s *ShootMaintenanceTest) TryUpdateCloudProfileForMaintenance(ctx context.Context, shoot *gardencorev1beta1.Shoot, ...) error
- func (s *ShootMaintenanceTest) TryUpdateShootForKubernetesMaintenance(ctx context.Context, shootToUpdate *gardencorev1beta1.Shoot) error
- func (s *ShootMaintenanceTest) TryUpdateShootForMachineImageMaintenance(ctx context.Context, shootToUpdate *gardencorev1beta1.Shoot, ...) error
- func (s *ShootMaintenanceTest) WaitForExpectedKubernetesVersionMaintenance(ctx context.Context, targetVersion string, ...) error
- func (s *ShootMaintenanceTest) WaitForExpectedMachineImageMaintenance(ctx context.Context, targetMachineImage gardencorev1beta1.ShootMachineImage, ...) error
- type UpdateShootFunc
- type WorkerGardenerTest
Constants ¶
const ( // 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") )
var ( // TemplateDir relative path for helm templates dir TemplateDir = filepath.Join("..", "..", "resources", "templates") )
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 ChooseRegionAndZoneWithNoSeed ¶
func ChooseRegionAndZoneWithNoSeed(regions []gardencorev1beta1.Region, seeds []gardencorev1beta1.Seed) (*gardencorev1beta1.Region, error)
ChooseRegionAndZoneWithNoSeed chooses a region within the cloud provider of the shoot were no seed is deployed and that is allowed by the cloud profile
func CreatePlantTestArtifacts ¶
func CreatePlantTestArtifacts(plantTestYamlPath string) (*gardencorev1beta1.Plant, error)
CreatePlantTestArtifacts creates a plant object which is read from the resources directory
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 EnsureDirectories ¶
EnsureDirectories creates the repository directory which holds the repositories.yaml config file
func GetDeploymentReplicas ¶
func GetDeploymentReplicas(ctx context.Context, client client.Client, namespace, name string) (*int32, error)
GetDeploymentReplicas gets the spec.Replicas count from a deployment
func GetObjectFromSecret ¶
func GetObjectFromSecret(ctx context.Context, k8sClient kubernetes.Interface, namespace, secretName, objectKey string) (string, error)
GetObjectFromSecret returns object from secret
func GetProjectRootPath ¶
func GetProjectRootPath() string
GetProjectRootPath gets the root path of the project relative to the integration test folder
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 ReadObject ¶
func ReadObject(file string, into apimachineryRuntime.Object) error
ReadObject loads the contents of file and decodes it as an object.
func ScaleDeployment ¶ added in v1.2.0
func ScaleDeployment(setupContextTimeout time.Duration, client client.Client, desiredReplicas *int32, name, namespace string) (*int32, error)
ScaleDeployment scales a deployment and waits until it is scaled
func ScaleGardenerControllerManager ¶
func ScaleGardenerControllerManager(setupContextTimeout time.Duration, client client.Client, desiredReplicas *int32) (*int32, error)
ScaleGardenerControllerManager scales the gardener-controller-manager to the desired replicas
func ScaleGardenerScheduler ¶
func ScaleGardenerScheduler(setupContextTimeout time.Duration, client client.Client, desiredReplicas *int32) (*int32, error)
ScaleGardenerScheduler scales the gardener-scheduler to the desired replicas
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 ShootCreationCompleted ¶
func ShootCreationCompleted(newShoot *gardencorev1beta1.Shoot) bool
ShootCreationCompleted checks if a shoot is successfully reconciled.
Types ¶
type EventFilterFunc ¶
EventFilterFunc is a function to filter events
type GardenerTestOperation ¶
type GardenerTestOperation struct { Logger logrus.FieldLogger GardenClient kubernetes.Interface SeedClient kubernetes.Interface ShootClient kubernetes.Interface Seed *gardencorev1beta1.Seed CloudProfile *gardencorev1beta1.CloudProfile Shoot *gardencorev1beta1.Shoot Project *gardencorev1beta1.Project }
GardenerTestOperation holds all required instances for doing a test operation
func NewGardenTestOperation ¶
func NewGardenTestOperation(k8sGardenClient kubernetes.Interface, logger logrus.FieldLogger) (*GardenerTestOperation, error)
NewGardenTestOperation initializes a new test operation from a gardener kubernetes interface
func NewGardenTestOperationWithShoot ¶
func NewGardenTestOperationWithShoot(ctx context.Context, k8sGardenClient kubernetes.Interface, logger logrus.FieldLogger, shoot *gardencorev1beta1.Shoot) (*GardenerTestOperation, error)
NewGardenTestOperationWithShoot initializes a new test operation from created shoot Objects that can be used to issue commands against seeds and shoots
func (*GardenerTestOperation) AddShoot ¶
func (o *GardenerTestOperation) AddShoot(ctx context.Context, shoot *gardencorev1beta1.Shoot) error
AddShoot sets the shoot and its seed for the GardenerOperation.
func (*GardenerTestOperation) AfterEach ¶
func (o *GardenerTestOperation) AfterEach(ctx context.Context)
AfterEach greps all necessary logs and state of the cluster if the test failed
func (*GardenerTestOperation) DashboardAvailable ¶
func (o *GardenerTestOperation) DashboardAvailable(ctx context.Context) error
DashboardAvailable checks if the kubernetes dashboard is available
func (*GardenerTestOperation) DeployChart ¶
func (o *GardenerTestOperation) DeployChart(ctx context.Context, namespace, chartRepoDestination, chartNameToDeploy string, values map[string]interface{}) error
DeployChart deploys it on the test shoot
func (*GardenerTestOperation) DownloadChartArtifacts ¶
func (o *GardenerTestOperation) 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 (*GardenerTestOperation) DownloadKubeconfig ¶
func (o *GardenerTestOperation) DownloadKubeconfig(ctx context.Context, client kubernetes.Interface, namespace, name, downloadPath string) error
DownloadKubeconfig downloads the shoot Kubeconfig
func (*GardenerTestOperation) DumpState ¶
func (o *GardenerTestOperation) DumpState(ctx context.Context)
DumpState greps all necessary logs and state of the cluster if the test failed
func (*GardenerTestOperation) GetDashboardPodIP ¶
func (o *GardenerTestOperation) GetDashboardPodIP(ctx context.Context) (string, error)
GetDashboardPodIP gets the dashboard IP
func (*GardenerTestOperation) GetElasticsearchLogs ¶
func (o *GardenerTestOperation) GetElasticsearchLogs(ctx context.Context, elasticsearchNamespace, podName string, client kubernetes.Interface) (*SearchResponse, error)
GetElasticsearchLogs gets logs for <podName> from the elasticsearch instance in <elasticsearchNamespace>
func (*GardenerTestOperation) GetFirstRunningPodWithLabels ¶
func (o *GardenerTestOperation) 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 (*GardenerTestOperation) GetPodsByLabels ¶
func (o *GardenerTestOperation) 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 (*GardenerTestOperation) KibanaDashboardAvailable ¶
func (o *GardenerTestOperation) KibanaDashboardAvailable(ctx context.Context) error
KibanaDashboardAvailable checks if Kibana instance in shoot seed namespace is available
func (*GardenerTestOperation) PodExecByLabel ¶
func (o *GardenerTestOperation) 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 (*GardenerTestOperation) ShootSeedNamespace ¶
func (o *GardenerTestOperation) ShootSeedNamespace() string
ShootSeedNamespace gets the shoot namespace in the seed
func (*GardenerTestOperation) WaitUntilDaemonSetIsRunning ¶
func (o *GardenerTestOperation) WaitUntilDaemonSetIsRunning(ctx context.Context, daemonSetName, daemonSetNamespace string, c kubernetes.Interface) error
WaitUntilDaemonSetIsRunning waits until the daemon set with <daemonSetName> is running
func (*GardenerTestOperation) WaitUntilDeploymentIsRunning ¶
func (o *GardenerTestOperation) WaitUntilDeploymentIsRunning(ctx context.Context, deploymentName, deploymentNamespace string, c kubernetes.Interface) error
WaitUntilDeploymentIsRunning waits until the deployment with <deploymentName> is running
func (*GardenerTestOperation) WaitUntilDeploymentsWithLabelsIsReady ¶
func (o *GardenerTestOperation) WaitUntilDeploymentsWithLabelsIsReady(ctx context.Context, deploymentLabels labels.Selector, namespace string, client kubernetes.Interface) error
WaitUntilDeploymentsWithLabelsIsReady wait until pod with labels <podLabels> is running
func (*GardenerTestOperation) WaitUntilElasticsearchReceivesLogs ¶
func (o *GardenerTestOperation) WaitUntilElasticsearchReceivesLogs(ctx context.Context, elasticsearchNamespace, podName string, expected uint64, client kubernetes.Interface) error
WaitUntilElasticsearchReceivesLogs waits until the elasticsearch instance in <elasticsearchNamespace> receives <expected> logs from <podName>
func (*GardenerTestOperation) WaitUntilGuestbookAppIsAvailable ¶
func (o *GardenerTestOperation) WaitUntilGuestbookAppIsAvailable(ctx context.Context, guestbookAppUrls []string) error
WaitUntilGuestbookAppIsAvailable waits until the guestbook app is available and ready to serve requests
func (*GardenerTestOperation) WaitUntilPodIsRunning ¶
func (o *GardenerTestOperation) WaitUntilPodIsRunning(ctx context.Context, podName, podNamespace string, c kubernetes.Interface) error
WaitUntilPodIsRunning waits until the pod with <podName> is running
func (*GardenerTestOperation) WaitUntilPodIsRunningWithLabels ¶
func (o *GardenerTestOperation) WaitUntilPodIsRunningWithLabels(ctx context.Context, labels labels.Selector, podNamespace string, c kubernetes.Interface) error
WaitUntilPodIsRunningWithLabels waits until the pod with <podLabels> is running
func (*GardenerTestOperation) WaitUntilStatefulSetIsRunning ¶
func (o *GardenerTestOperation) WaitUntilStatefulSetIsRunning(ctx context.Context, statefulSetName, statefulSetNamespace string, c kubernetes.Interface) error
WaitUntilStatefulSetIsRunning waits until the stateful set with <statefulSetName> is running
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 PlantTest ¶
type PlantTest struct { GardenClient kubernetes.Interface Plant *gardencorev1beta1.Plant //PlantSecret *v1.Secret Logger *logrus.Logger // contains filtered or unexported fields }
PlantTest represents an instance of shoot tests which entails all necessary data
func NewPlantTest ¶
func NewPlantTest(kubeconfig string, kubeconfigPathExternalCluster string, plant *gardencorev1beta1.Plant, logger *logrus.Logger) (*PlantTest, error)
NewPlantTest creates a new plantGardenerTest object, given an already created plant (created after parsing a plant YAML) and a path to a kubeconfig of an external cluster
func (*PlantTest) CreatePlant ¶
CreatePlant Creates a plant from a plant Object
func (*PlantTest) CreatePlantSecret ¶
func (s *PlantTest) CreatePlantSecret(ctx context.Context, kubeConfigContent []byte) (*corev1.Secret, error)
CreatePlantSecret creates a new Secret for the Plant
func (*PlantTest) DeletePlant ¶
DeletePlant deletes the test plant
func (*PlantTest) GetPlantSecret ¶
GetPlantSecret retrieves the Secret of the Plant. Returns the Secret.
func (*PlantTest) UpdatePlantSecret ¶
UpdatePlantSecret updates the Secret of the Plant
func (*PlantTest) WaitForPlantToBeCreated ¶
WaitForPlantToBeCreated waits for the plant to be created
func (*PlantTest) WaitForPlantToBeDeleted ¶
WaitForPlantToBeDeleted waits for the plant to be deleted
func (*PlantTest) WaitForPlantToBeReconciledSuccessfully ¶
WaitForPlantToBeReconciledSuccessfully waits for the plant to be reconciled with a status indicating success
type SchedulerGardenerTest ¶
type SchedulerGardenerTest struct { ShootGardenerTest *ShootGardenerTest CloudProfile *gardencorev1beta1.CloudProfile SchedulerConfiguration *config.SchedulerConfiguration Seeds []gardencorev1beta1.Seed }
SchedulerGardenerTest represents an instance of scheduler tests which contains a shoot test & adds the scheduler configuration
func NewGardenSchedulerTest ¶
func NewGardenSchedulerTest(ctx context.Context, shootGardenTest *ShootGardenerTest, hostKubeconfigPath string) (*SchedulerGardenerTest, error)
NewGardenSchedulerTest creates a new SchedulerGardenerTest by retrieving the ConfigMap containing the Scheduler Configuration & parsing the Scheduler Configuration
func (*SchedulerGardenerTest) ChooseRegionAndZoneWithNoSeed ¶
func (s *SchedulerGardenerTest) ChooseRegionAndZoneWithNoSeed() (*gardencorev1beta1.Region, error)
ChooseRegionAndZoneWithNoSeed determines all available Zones from the Shoot and the CloudProfile and then delegates the choosing of a region were no seed is deployed
func (*SchedulerGardenerTest) ChooseSeedWhereTestShootIsNotDeployed ¶
func (s *SchedulerGardenerTest) ChooseSeedWhereTestShootIsNotDeployed(shoot *gardencorev1beta1.Shoot) (*gardencorev1beta1.Seed, error)
ChooseSeedWhereTestShootIsNotDeployed determines a Seed different from the shoot's seed using the same Provider(e.g aws) If none can be found, it returns an error
func (*SchedulerGardenerTest) CreateShoot ¶
func (s *SchedulerGardenerTest) CreateShoot(ctx context.Context) (*gardencorev1beta1.Shoot, error)
CreateShoot Creates a shoot from a shoot Object
func (*SchedulerGardenerTest) GenerateInvalidSeed ¶
func (s *SchedulerGardenerTest) GenerateInvalidSeed() (*gardencorev1beta1.Seed, error)
GenerateInvalidSeed generates a seed with an invalid dummy name
func (*SchedulerGardenerTest) GenerateInvalidShoot ¶
func (s *SchedulerGardenerTest) GenerateInvalidShoot() (*gardencorev1beta1.Shoot, error)
GenerateInvalidShoot generates a shoot with an invalid dummy name
func (*SchedulerGardenerTest) ScheduleShoot ¶
func (s *SchedulerGardenerTest) ScheduleShoot(ctx context.Context, shoot *gardencorev1beta1.Shoot, seed *gardencorev1beta1.Seed) error
ScheduleShoot set the Spec.Cloud.Seed of a shoot to the specified seed. This is the request the Gardener Scheduler executes after a scheduling decision.
func (*SchedulerGardenerTest) WaitForShootToBeScheduled ¶
func (s *SchedulerGardenerTest) WaitForShootToBeScheduled(ctx context.Context) error
WaitForShootToBeScheduled waits for the shoot to be scheduled successfully
func (*SchedulerGardenerTest) WaitForShootToBeUnschedulable ¶
func (s *SchedulerGardenerTest) WaitForShootToBeUnschedulable(ctx context.Context) error
WaitForShootToBeUnschedulable waits for the shoot to be unschedulable. This is indicated by Events created by the scheduler on the shoot
type SearchResponse ¶
type SearchResponse struct { Hits struct { Total uint64 `json:"total"` } `json:"hits"` }
SearchResponse represents the response from a search query to elasticsearch
type ShootGardenerTest ¶
type ShootGardenerTest struct { GardenClient kubernetes.Interface Shoot *gardencorev1beta1.Shoot CloudProfile *gardencorev1beta1.CloudProfile Logger *logrus.Logger }
ShootGardenerTest represents an instance of shoot tests which entails all necessary data
func NewShootGardenerTest ¶
func NewShootGardenerTest(kubeconfig string, shoot *gardencorev1beta1.Shoot, logger *logrus.Logger) (*ShootGardenerTest, error)
NewShootGardenerTest creates a new shootGardenerTest object, given an already created shoot (created after parsing a shoot YAML)
func (*ShootGardenerTest) AnnotateShoot ¶
AnnotateShoot adds shoot annotation(s)
func (*ShootGardenerTest) CreateShoot ¶
func (s *ShootGardenerTest) CreateShoot(ctx context.Context) (*gardencorev1beta1.Shoot, error)
CreateShoot Creates a shoot from a shoot Object and waits until it is successfully reconciled
func (*ShootGardenerTest) CreateShootResource ¶
func (s *ShootGardenerTest) CreateShootResource(ctx context.Context, shootToCreate *gardencorev1beta1.Shoot) (*gardencorev1beta1.Shoot, error)
CreateShootResource creates a shoot from a shoot Object
func (*ShootGardenerTest) DeleteShoot ¶
func (s *ShootGardenerTest) DeleteShoot(ctx context.Context) error
DeleteShoot deletes the test shoot
func (*ShootGardenerTest) DeleteShootAndWaitForDeletion ¶
func (s *ShootGardenerTest) DeleteShootAndWaitForDeletion(ctx context.Context) error
DeleteShootAndWaitForDeletion deletes the test shoot and waits until it cannot be found any more
func (*ShootGardenerTest) GetShoot ¶
func (s *ShootGardenerTest) GetShoot(ctx context.Context) (*gardencorev1beta1.Shoot, error)
GetShoot gets the test shoot
func (*ShootGardenerTest) HibernateShoot ¶
func (s *ShootGardenerTest) HibernateShoot(ctx context.Context) error
HibernateShoot hibernates the test shoot
func (*ShootGardenerTest) RemoveShootAnnotation ¶
func (s *ShootGardenerTest) RemoveShootAnnotation(ctx context.Context, annotationKey string) error
RemoveShootAnnotation removes an annotation with key <annotationKey> from a shoot object
func (*ShootGardenerTest) SetupShootWorker ¶
func (s *ShootGardenerTest) SetupShootWorker(workerZone *string) error
SetupShootWorker prepares the Shoot with one worker with provider specific volume. Clears the currently configured workers.
func (*ShootGardenerTest) UpdateShoot ¶
func (s *ShootGardenerTest) UpdateShoot(ctx context.Context, shoot *gardencorev1beta1.Shoot, update UpdateShootFunc) (*gardencorev1beta1.Shoot, error)
UpdateShoot Updates a shoot from a shoot Object and waits for its reconciliation
func (*ShootGardenerTest) WaitForShootToBeCreated ¶
func (s *ShootGardenerTest) WaitForShootToBeCreated(ctx context.Context) error
WaitForShootToBeCreated waits for the shoot to be created
func (*ShootGardenerTest) WaitForShootToBeDeleted ¶
func (s *ShootGardenerTest) WaitForShootToBeDeleted(ctx context.Context) error
WaitForShootToBeDeleted waits for the shoot to be deleted
func (*ShootGardenerTest) WaitForShootToBeReconciled ¶
func (s *ShootGardenerTest) WaitForShootToBeReconciled(ctx context.Context) error
WaitForShootToBeReconciled waits for the shoot to be successfully reconciled
func (*ShootGardenerTest) WakeUpShoot ¶
func (s *ShootGardenerTest) WakeUpShoot(ctx context.Context) error
WakeUpShoot wakes up the test shoot from hibernation
type ShootMaintenanceTest ¶
type ShootMaintenanceTest struct { ShootGardenerTest *ShootGardenerTest CloudProfile *gardencorev1beta1.CloudProfile ShootMachineImage gardencorev1beta1.ShootMachineImage }
ShootMaintenanceTest contains all necessary data for the shoot maintenance integration test
func NewShootMaintenanceTest ¶
func NewShootMaintenanceTest(ctx context.Context, shootGardenTest *ShootGardenerTest, shootMachineImageName *string) (*ShootMaintenanceTest, error)
NewShootMaintenanceTest creates a new ShootMaintenanceTest
func (*ShootMaintenanceTest) CleanupCloudProfile ¶
func (s *ShootMaintenanceTest) CleanupCloudProfile(ctx context.Context, testMachineImage gardencorev1beta1.ShootMachineImage, testKubernetesVersions []gardencorev1beta1.ExpirableVersion) error
CleanupCloudProfile tries to update the CloudProfile with retries to make sure the machine image version & kubernetes version introduced during the integration test is being removed
func (*ShootMaintenanceTest) CreateShoot ¶
func (s *ShootMaintenanceTest) CreateShoot(ctx context.Context) (*gardencorev1beta1.Shoot, error)
CreateShoot creates a Shoot Resource
func (*ShootMaintenanceTest) TryUpdateCloudProfileForKubernetesVersionMaintenance ¶
func (s *ShootMaintenanceTest) TryUpdateCloudProfileForKubernetesVersionMaintenance(ctx context.Context, shoot *gardencorev1beta1.Shoot, targetVersion string, expirationDateInNearFuture *metav1.Time) error
TryUpdateCloudProfileForKubernetesVersionMaintenance tries to update the images of the Cloud Profile
func (*ShootMaintenanceTest) TryUpdateCloudProfileForMaintenance ¶
func (s *ShootMaintenanceTest) TryUpdateCloudProfileForMaintenance(ctx context.Context, shoot *gardencorev1beta1.Shoot, testMachineImage gardencorev1beta1.ShootMachineImage, expirationDate *metav1.Time) error
TryUpdateCloudProfileForMaintenance tries to update the images of the Cloud Profile
func (*ShootMaintenanceTest) TryUpdateShootForKubernetesMaintenance ¶
func (s *ShootMaintenanceTest) TryUpdateShootForKubernetesMaintenance(ctx context.Context, shootToUpdate *gardencorev1beta1.Shoot) error
TryUpdateShootForKubernetesMaintenance tries to update the maintenance section of the shoot spec regarding the Kubernetes version
func (*ShootMaintenanceTest) TryUpdateShootForMachineImageMaintenance ¶
func (s *ShootMaintenanceTest) TryUpdateShootForMachineImageMaintenance(ctx context.Context, shootToUpdate *gardencorev1beta1.Shoot, updateMachineImage bool, workers []gardencorev1beta1.Worker) error
TryUpdateShootForMachineImageMaintenance tries to update the maintenance section of the shoot spec regarding the machine image
func (*ShootMaintenanceTest) WaitForExpectedKubernetesVersionMaintenance ¶
func (s *ShootMaintenanceTest) WaitForExpectedKubernetesVersionMaintenance(ctx context.Context, targetVersion string, kubernetesVersionUpdateRequired bool, deadline time.Time) error
WaitForExpectedKubernetesVersionMaintenance polls a shoot until the given deadline is exceeded. Checks if the shoot's kubernetes version equals the targetVersion and if an kubernetes version update is required.
func (*ShootMaintenanceTest) WaitForExpectedMachineImageMaintenance ¶
func (s *ShootMaintenanceTest) WaitForExpectedMachineImageMaintenance(ctx context.Context, targetMachineImage gardencorev1beta1.ShootMachineImage, imageUpdateRequired bool, deadline time.Time) error
WaitForExpectedMachineImageMaintenance polls a shoot until the given deadline is exceeded. Checks if the shoot's machine image equals the targetImage and if an image update is required.
type UpdateShootFunc ¶
type UpdateShootFunc = func(shoot *gardencorev1beta1.Shoot) error
UpdateShootFunc represents a function that mutates the shoot to be updated
type WorkerGardenerTest ¶
type WorkerGardenerTest struct { ShootGardenerTest *ShootGardenerTest CloudProfile *gardencorev1beta1.CloudProfile ShootClient kubernetes.Interface }
WorkerGardenerTest represents an instance of worker tests which contains a shoot test & adds the worker configuration
func NewWorkerGardenerTest ¶
func NewWorkerGardenerTest(shootGardenTest *ShootGardenerTest) (*WorkerGardenerTest, error)
NewWorkerGardenerTest creates a new NewWorkerGardenerTest
func (*WorkerGardenerTest) SetupShootWorkers ¶
func (s *WorkerGardenerTest) SetupShootWorkers(shootMachineImageName *string, shootMachineImageName2 *string, workerZone *string) error
SetupShootWorkers prepares the Shoot with multiple workers. Only supporting one optional zone.