Documentation ¶
Index ¶
- Constants
- func ConfigToVars(c TestRunConfig) (kubeconfigPath, dsiNamePrefix, dataservice, namespace string)
- func GenerateName(name string, id, suffixLength int) string
- func GenerateRandString(n int) string
- func GetPrimaryPodUsingServiceSelector(ctx context.Context, dsi runtimeClient.Object, c runtimeClient.Client) (*corev1.Pod, error)
- func PortForward(ctx context.Context, targetPort int, pathToKubeConfig string, ...) (chan struct{}, int, error)
- func PortForwardPod(ctx context.Context, targetPort int, pathToKubeConfig string, pod *corev1.Pod, ...) (chan struct{}, int, error)
- func UniqueName(name string, length int) string
- type TestRunConfig
Constants ¶
const (
AsyncOpsTimeoutMins = time.Minute * 5
)
Variables ¶
This section is empty.
Functions ¶
func ConfigToVars ¶
func ConfigToVars(c TestRunConfig) (kubeconfigPath, dsiNamePrefix, dataservice, namespace string)
func GenerateName ¶
func GenerateRandString ¶
GenerateRandString generates a random string of fixed size.
func GetPrimaryPodUsingServiceSelector ¶
func GetPrimaryPodUsingServiceSelector(ctx context.Context, dsi runtimeClient.Object, c runtimeClient.Client, ) (*corev1.Pod, error)
TODO: Wait for primary pod explicitly in test setup rather than here. Asynchronous assertions are better exposed at the top level of the setup than hidden within the port forward logic itself. GetPrimaryPodUsingServiceSelector requires an eventually assertion since Patroni only applies the master label once quorum has been achieved. We must wait for this before we can know which pod to portforward to using the service selector.
func PortForward ¶
func PortForward(ctx context.Context, targetPort int, pathToKubeConfig string, dsi runtimeClient.Object, c runtimeClient.Client, ) (chan struct{}, int, error)
PortForward establishes a port-forward from a randomly selected local port to port `targetPort` of `dsi`. To terminate the port-forward, close the returned channel. The other return arguments are the selected local port, and an error in case of failure.
func PortForwardPod ¶
func PortForwardPod(ctx context.Context, targetPort int, pathToKubeConfig string, pod *corev1.Pod, c runtimeClient.Client, ) (chan struct{}, int, error)
PortForwardPod d establishes a port-forward from a randomly selected local port to port `targetPort` of `pod`.
To terminate the port-forward, close the returned channel. The other return arguments are the selected local port, and an error in case of failure.
func UniqueName ¶
Types ¶
type TestRunConfig ¶
type TestRunConfig struct { // KubeconfigPath is the path to the kube config to be used by the Kubernetes client KubeconfigPath string // Dataservice is the dataservice the tests are to be performed on Dataservice string // DSINamePrefix provides a name that the DSI object will take in the cluster DSINamePrefix string // Namespace provides the target namespace to be used for testing. If not given then a // unique namespace is created. Namespace string }
func ParseEnv ¶
func ParseEnv() (TestRunConfig, error)
TODO: Use marshalling approach to provide more fine grained feedback on missing environment variables.
Directories ¶
Path | Synopsis |
---|---|
chaos is a utility package for injecting faults into running instances.
|
chaos is a utility package for injecting faults into running instances. |