Documentation ¶
Index ¶
- Constants
- Variables
- func CreateShootTestArtifacts(shootTestYamlPath, prefix string) (string, *v1beta1.Shoot, error)
- func EnsureDirectories(helm Helm) error
- func Exists(path string) (bool, error)
- func ReadObject(file string, into runtime.Object) error
- type GardenerTestOperation
- 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) GetDashboardPodIP(ctx context.Context) (string, error)
- func (o *GardenerTestOperation) GetElasticsearchLogs(ctx context.Context, elasticsearchNamespace, podName string, ...) (*SearchResponse, error)
- func (o *GardenerTestOperation) GetFirstNodeInternalIP(ctx context.Context) (string, 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) 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) WaitUntilStatefulSetIsRunning(ctx context.Context, statefulSetName, statefulSetNamespace string, ...) error
- type Helm
- type HelmAccess
- type SearchResponse
- type ShootGardenerTest
- func (s *ShootGardenerTest) AnnotateShoot(ctx context.Context, annotations map[string]string) error
- func (s *ShootGardenerTest) CreateShoot(ctx context.Context) (*v1beta1.Shoot, error)
- func (s *ShootGardenerTest) DeleteShoot(ctx context.Context) error
- func (s *ShootGardenerTest) GetShoot(ctx context.Context) (*v1beta1.Shoot, error)
- func (s *ShootGardenerTest) RemoveShootAnnotation(ctx context.Context, annotationKey string) error
- func (s *ShootGardenerTest) WaitForShootToBeCreated(ctx context.Context) error
- func (s *ShootGardenerTest) WaitForShootToBeDeleted(ctx context.Context) error
Constants ¶
const (
// IntegrationTestPrefix is the default prefix that will be used for test shoots if none other is specified
IntegrationTestPrefix = "itest-"
)
Variables ¶
var ( // ErrNoRepositoriesFound no repositories found in repoitories file ErrNoRepositoriesFound = errors.New("no repositories found in repoitories 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 ( // GuestBookTemplateDir relative path for guestbook app template dir GuestBookTemplateDir = filepath.Join("..", "..", "resources", "templates") )
Functions ¶
func CreateShootTestArtifacts ¶
CreateShootTestArtifacts creates the necessary artifacts for a shoot tests including a random integration test name and a shoot object which is read from the resources directory
func EnsureDirectories ¶
EnsureDirectories creates the repository directory which holds the repositories.yaml config file
Types ¶
type GardenerTestOperation ¶
type GardenerTestOperation struct { Logger logrus.FieldLogger GardenClient kubernetes.Interface SeedClient kubernetes.Interface ShootClient kubernetes.Interface Seed *v1beta1.Seed Shoot *v1beta1.Shoot Project *v1beta1.Project }
GardenerTestOperation holds all required instances for doing a test operation
func NewGardenTestOperation ¶
func NewGardenTestOperation(ctx context.Context, k8sGardenClient kubernetes.Interface, logger logrus.FieldLogger, shoot *v1beta1.Shoot) (*GardenerTestOperation, error)
NewGardenTestOperation initializes a new test operation from created shoot Objects that can be used to issue commands against seeds and shoots
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) error
DeployChart deploys it on the test shoot
func (*GardenerTestOperation) DownloadChartArtifacts ¶
func (o *GardenerTestOperation) DownloadChartArtifacts(ctx context.Context, helm Helm, chartRepoDestination, chartNameToDownload 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) 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) GetFirstNodeInternalIP ¶
func (o *GardenerTestOperation) GetFirstNodeInternalIP(ctx context.Context) (string, error)
GetFirstNodeInternalIP gets the internal IP of the first node
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) 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) 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 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 *v1beta1.Shoot Logger *logrus.Logger }
ShootGardenerTest represents an instance of shoot tests which entails all necessary data
func NewShootGardenerTest ¶
func NewShootGardenerTest(kubeconfig string, shoot *v1beta1.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 ¶
CreateShoot 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) RemoveShootAnnotation ¶
func (s *ShootGardenerTest) RemoveShootAnnotation(ctx context.Context, annotationKey string) error
RemoveShootAnnotation removes an annotation with key <annotationKey> from a shoot object
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