utils

package
v0.0.0-...-cf9bbde Latest Latest
Warning

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

Go to latest
Published: Jun 21, 2022 License: MIT Imports: 24 Imported by: 0

Documentation

Index

Constants

View Source
const (
	AzureResourceGroup             = "AZURE_RESOURCE_GROUP"
	AzureVNetName                  = "AZURE_VNET_NAME"
	ClusterIdentityName            = "CLUSTER_IDENTITY_NAME"
	ClusterIdentityNamespace       = "CLUSTER_IDENTITY_NAMESPACE"
	ClusterIdentitySecretName      = "AZURE_CLUSTER_IDENTITY_SECRET_NAME"
	ClusterIdentitySecretNamespace = "AZURE_CLUSTER_IDENTITY_SECRET_NAMESPACE"
	AzureClientSecret              = "AZURE_CLIENT_SECRET"
	SshPort                        = "22"
	RedactLogScriptPath            = "REDACT_LOG_SCRIPT"
	AKSKubernetesVersion           = "AKS_KUBERNETES_VERSION"
	AzureLocation                  = "AZURE_LOCATION"
	ManagedClustersResourceType    = "managedClusters"
)

Variables

This section is empty.

Functions

func Byf

func Byf(format string, a ...interface{})

func DumpSpecResourcesAndCleanup

func DumpSpecResourcesAndCleanup(ctx context.Context, input CleanupInput)

func ExecOnHost

func ExecOnHost(controlPlaneEndpoint, hostname, port string, f io.StringWriter, command string,
	args ...string) error

ExecOnHost runs the specified command directly on a node's host, using an SSH connection proxied through a control plane host.

func ExpectResourceGroupToBe404

func ExpectResourceGroupToBe404(ctx context.Context)

ExpectResourceGroupToBe404 performs a GET request to Azure to determine if the cluster resource group still exists. If it does still exist, it means the cluster was not deleted and is leaking Azure resources.

func FileOnHost

func FileOnHost(path string) (*os.File, error)

FileOnHost creates the specified path, including parent directories if needed.

func GetClusterName

func GetClusterName(prefix, specName string) string

GetClusterName gets the cluster name for the test cluster and sets the environment variables that depend on it.

func Log

func Log(message string)

Log prints info logs with a timestamp.

func LogCheckpoint

func LogCheckpoint(specTimes map[string]time.Time)

LogCheckpoint prints a message indicating the start or end of the current test spec, including which Ginkgo node it's running on.

Example output:

INFO: "With 1 worker node" started at Tue, 22 Sep 2020 13:19:08 PDT on Ginkgo node 2 of 3
INFO: "With 1 worker node" ran for 18m34s on Ginkgo node 2 of 3

func Logf

func Logf(format string, args ...interface{})

Logf prints info logs with a timestamp and formatting.

func SetupSpecNamespace

func SetupSpecNamespace(ctx context.Context, namespaceName string, clusterProxy framework.ClusterProxy, artifactFolder string) (*corev1.Namespace, context.CancelFunc, error)

Types

type CleanupInput

type CleanupInput struct {
	SpecName          string
	ClusterProxy      framework.ClusterProxy
	ArtifactFolder    string
	Namespace         *corev1.Namespace
	CancelWatches     context.CancelFunc
	Cluster           *clusterv1.Cluster
	IntervalsGetter   func(spec, key string) []interface{}
	SkipCleanup       bool
	GetLogs           bool
	AdditionalCleanup func()
	E2eConfig         *clusterctl.E2EConfig
}

Jump to

Keyboard shortcuts

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