util

package
v0.0.0-...-949eaf4 Latest Latest
Warning

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

Go to latest
Published: Aug 26, 2021 License: Apache-2.0 Imports: 23 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DeleteNamespace

func DeleteNamespace(ctx context.Context, client crclient.Client, namespace string)

DeleteNamespace deletes and finalizes the given namespace, logging any failures along the way.

func DumpAndDestroyHostedCluster

func DumpAndDestroyHostedCluster(ctx context.Context, hostedCluster *hyperv1.HostedCluster, awsCreds string, awsRegion string, baseDomain string, artifactDir string)

DumpAndDestroyHostedCluster calls DumpHostedCluster and then destroys the HostedCluster, logging any failures along the way.

func DumpGuestCluster

func DumpGuestCluster(ctx context.Context, client crclient.Client, hostedCluster *hyperv1.HostedCluster, destDir string)

DumpGuestCluster tries to collect resources from the from the hosted cluster, and logs any failures that occur.

func DumpHostedCluster

func DumpHostedCluster(ctx context.Context, hostedCluster *hyperv1.HostedCluster, artifactDir string)

DumpHostedCluster tries to dump important resources related to the HostedCluster, and logs any failures along the way.

func GenerateNamespace

func GenerateNamespace(t *testing.T, ctx context.Context, client crclient.Client, prefix string) *corev1.Namespace

func GetClientOrDie

func GetClientOrDie() crclient.Client

GetClientOrDie creates a controller-runtime client for Kubernetes

func GetConfigOrDie

func GetConfigOrDie() *rest.Config

GetConfigOrDie creates a REST config from current context

func WaitForGuestClient

func WaitForGuestClient(t *testing.T, ctx context.Context, client crclient.Client, hostedCluster *hyperv1.HostedCluster) crclient.Client

func WaitForGuestKubeConfig

func WaitForGuestKubeConfig(ctx context.Context, client crclient.Client, hostedCluster *hyperv1.HostedCluster) ([]byte, error)

func WaitForImageRollout

func WaitForImageRollout(t *testing.T, ctx context.Context, client crclient.Client, hostedCluster *hyperv1.HostedCluster, image string)

func WaitForNReadyNodes

func WaitForNReadyNodes(t *testing.T, ctx context.Context, client crclient.Client, n int32) []corev1.Node

Types

type NameGenerator

type NameGenerator interface {
	// GenerateName generates a valid name from the base name, adding a random suffix to the
	// the base. If base is valid, the returned name must also be valid. The generator is
	// responsible for knowing the maximum valid name length.
	GenerateName(base string) string
}

NameGenerator generates names for objects. Some backends may have more information available to guide selection of new names and this interface hides those details.

var SimpleNameGenerator NameGenerator = simpleNameGenerator{}

SimpleNameGenerator is a generator that returns the name plus a random suffix of five alphanumerics when a name is requested. The string is guaranteed to not exceed the length of a standard Kubernetes name (63 characters)

Jump to

Keyboard shortcuts

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