resources

package
v0.0.1 Latest Latest
Warning

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

Go to latest
Published: Aug 10, 2023 License: Apache-2.0 Imports: 25 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AwaitResourceDeletionOrFail

func AwaitResourceDeletionOrFail(ctx context.Context, t *testing.T, cfg *envconf.Config, object k8s.Object)

AwaitResourceDeletionOrFail deletes a given k8s object with a timeout of 3 minutes

func AwaitResourceUpdateFor

func AwaitResourceUpdateFor(
	ctx context.Context,
	t *testing.T,
	cfg *envconf.Config,
	object k8s.Object,
	fn func(object k8s.Object) bool,
	opts ...wait.Option,
)

AwaitResourceUpdateFor waits for a given resource to be updated

func AwaitResourceUpdateOrError

func AwaitResourceUpdateOrError(ctx context.Context, t *testing.T, cfg *envconf.Config, object k8s.Object)

AwaitResourceUpdateOrError waits for a given resource to update with a timeout of 3 minutes

func DeleteResources

func DeleteResources(ctx context.Context, t *testing.T, cfg *envconf.Config, manifestDir string, timeout wait.Option) context.Context

DeleteResources deletes previously imported resources

func DumpManagedResources

func DumpManagedResources(ctx context.Context, t *testing.T, cfg *envconf.Config) context.Context

DumpManagedResources dumps resources with CRDs and Providers

func GetResourcesWithRESTConfig

func GetResourcesWithRESTConfig(cfg *envconf.Config) (*resources.Resources, error)

GetResourcesWithRESTConfig returns new resource from REST config

func Identifier

func Identifier(object k8s.Object) string

Identifier returns k8s object name

func ImportResources

func ImportResources(ctx context.Context, t *testing.T, cfg *envconf.Config, dir string)

ImportResources gets the resources from ./data/crs

func WaitForResourcesToBeSynced

func WaitForResourcesToBeSynced(
	ctx context.Context,
	cfg *envconf.Config,
	dir string,
	opts ...wait.Option,
) error

WaitForResourcesToBeSynced waits until all managed resources are synced and available

Types

type ResourceTestConfig

type ResourceTestConfig struct {
	Kind            string
	Obj             k8s.Object
	AdditionalSteps map[string]func(context.Context, *testing.T, *envconf.Config) context.Context
}

ResourceTestConfig is a test configuration for a resource. It contains the kind of resource and the object to be tested and then provides basic CRD tests for the resource.

func (*ResourceTestConfig) AssessCreate

func (r *ResourceTestConfig) AssessCreate(ctx context.Context, t *testing.T, cfg *envconf.Config) context.Context

AssessCreate checks that the resource was created successfully.

func (*ResourceTestConfig) AssessDelete

func (r *ResourceTestConfig) AssessDelete(ctx context.Context, t *testing.T, cfg *envconf.Config) context.Context

AssessDelete checks that the resource was deleted successfully.

func (*ResourceTestConfig) AssessUpdate

func (r *ResourceTestConfig) AssessUpdate(ctx context.Context, t *testing.T, cfg *envconf.Config) context.Context

AssessUpdate does nothing for now but exists here for completeness.

func (*ResourceTestConfig) Setup

Setup creates the resource in the cluster.

func (*ResourceTestConfig) Teardown

Teardown does nothing for now but exists here for completeness.

Jump to

Keyboard shortcuts

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