utils

package
v0.0.6 Latest Latest
Warning

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

Go to latest
Published: Apr 22, 2024 License: Apache-2.0 Imports: 22 Imported by: 0

Documentation

Overview

Package utils is a package that contains utility functions for the e2e tests.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ApplyWithSshuttle

func ApplyWithSshuttle(t *testing.T, terraformOptions *terraform.Options) error

ApplyWithSshuttle runs terraform apply with sshuttle running in the background.

func ConfigureKubeconfig

func ConfigureKubeconfig(t *testing.T, tempFolder string)

ConfigureKubeconfig idempotently uses the AWS CLI to configure the user's kubeconfig file with the new EKS cluster.

func DestroyWithSshuttle

func DestroyWithSshuttle(t *testing.T, terraformOptions *terraform.Options) error

DestroyWithSshuttle runs terraform destroy with sshuttle running in the background.

func DoLog

func DoLog(args ...interface{})

DoLog logs the given arguments to the given writer, along with a timestamp.

func DownloadZarfInitPackage

func DownloadZarfInitPackage(t *testing.T)

DownloadZarfInitPackage idempotently downloads the Zarf init package if it doesn't already exist.

func GenerateRandomHex

func GenerateRandomHex(n int) string

func GetEKSCluster

func GetEKSCluster(t *testing.T, tempFolder string) (*eks.Cluster, error)

GetEKSCluster returns the EKS cluster for the given terraform folder.

func NewK8sClientset

func NewK8sClientset(cluster *eks.Cluster) (*kubernetes.Clientset, error)

NewK8sClientset returns a new kubernetes clientset for the given cluster.

func RunSshuttleInBackground

func RunSshuttleInBackground(t *testing.T, tempFolder string) (*exec.Cmd, error)

RunSshuttleInBackground runs sshuttle in the background.

func SetDefaultEnvVar

func SetDefaultEnvVar(key, defaultValue string)

Helper function to set default environment variable if it's not already set.

func StopSshuttle

func StopSshuttle(t *testing.T, cmd *exec.Cmd) error

StopSshuttle stops sshuttle.

func ValidateEFSFunctionality

func ValidateEFSFunctionality(t *testing.T, tempFolder string)

ValidateEFSFunctionality idempotently validates that EFS functionality is working.

func ValidateZarfInit

func ValidateZarfInit(t *testing.T, tempFolder string)

ValidateZarfInit idempotently ensures that zarf init runs successfully.

Types

This section is empty.

Jump to

Keyboard shortcuts

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