utils

package
v0.0.1-0...-d499bc6 Latest Latest
Warning

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

Go to latest
Published: Nov 23, 2026 License: Apache-2.0 Imports: 19 Imported by: ? modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Overview

Package utils implements helper functions for the e2e tests.

Index

Constants

View Source
const (
	// Namespace is the default K8s namespace in which infra server is deployed.
	Namespace = "infra"
	// AppLabels are the default K8s labels attached to the infra server deployment.
	AppLabels = "infra-server"
)

Variables

This section is empty.

Functions

func AssertStatusBecomes

func AssertStatusBecomes(t *testing.T, clusterID string, desiredStatus string)

AssertStatusBecomes asserts that an infra cluster eventually reaches a desired status.

func AssertStatusBecomesWithin

func AssertStatusBecomesWithin(t *testing.T, clusterID string, desiredStatus string, timeout time.Duration)

AssertStatusBecomesWithin asserts that an infra cluster reaches a desired status within a defined time.

func AssertStatusRemainsFor

func AssertStatusRemainsFor(t *testing.T, clusterID string, desiredStatus string, timeout time.Duration)

AssertStatusRemainsFor asserts that an infra cluster remains in a desired status for a defined time.

func CheckContext

func CheckContext()

CheckContext aborts an execution if the current kubectl context is not an infra-pr cluster.

func CheckGCSObjectEventuallyDeleted

func CheckGCSObjectEventuallyDeleted(ctx context.Context, t *testing.T, clusterID string)

CheckGCSObjectEventuallyDeleted confirms that an object is eventually deletion from the GCS bucket.

func CheckGCSObjectExists

func CheckGCSObjectExists(ctx context.Context, clusterID string) (bool, error)

CheckGCSObjectExists confirms that an object exists in the GCS bucket.

func DeleteStatusConfigmap

func DeleteStatusConfigmap(namespace string) error

DeleteStatusConfigmap deletes the configmap named status in a given namespace.

func FindInfraPod

func FindInfraPod(ctx context.Context, namespace string, label string) (string, error)

FindInfraPod discovers the infra server pod.

func GetPodLogs

func GetPodLogs(namespace string, label string, startTime *metav1.Time) (string, error)

GetPodLogs retrieves the logs for a labeled pod from a given start time.

func GetUniqueClusterName

func GetUniqueClusterName(baseName string) string

GetUniqueClusterName adds some uniqueness to a cluster name.

Types

This section is empty.

Directories

Path Synopsis
Package mock implements helpers to mock infractl calls and outputs for tests.
Package mock implements helpers to mock infractl calls and outputs for tests.

Jump to

Keyboard shortcuts

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