integration

package
v0.0.1 Latest Latest
Warning

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

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

Documentation

Overview

Package integration provides utilities for integration testing Crossplane.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type BuilderFn

type BuilderFn func(client.Client) error

BuilderFn is a function that performs operations prior to starting test controllers

func NewBuilder

func NewBuilder() BuilderFn

NewBuilder returns a new no-op Builder

type CleanerFn

type CleanerFn func(*Manager) error

CleanerFn is a function that performs test cleanup

func NewCRDCleaner

func NewCRDCleaner() CleanerFn

NewCRDCleaner returns a new Cleaner that deletes all installed CRDs from the API server.

func NewCRDDirCleaner

func NewCRDDirCleaner() CleanerFn

NewCRDDirCleaner cleans up the tmp directory where CRDs were downloaded.

type Config

type Config struct {
	CRDPaths       []string
	Builder        BuilderFn
	Cleaners       []CleanerFn
	ManagerOptions manager.Options
}

Config is a set of configuration values for setup.

type Manager

type Manager struct {
	manager.Manager
	// contains filtered or unexported fields
}

Manager wraps a controller-runtime manager with additional functionality.

func New

func New(cfg *rest.Config, o ...Option) (*Manager, error)

New creates a new Manager.

func (*Manager) Cleanup

func (m *Manager) Cleanup() error

Cleanup runs the supplied cleanup or defaults to deleting all CRDs.

func (*Manager) GetClient

func (m *Manager) GetClient() client.Client

GetClient returns a Kubernetes rest client.

func (*Manager) Run

func (m *Manager) Run()

Run starts a controller-runtime manager with a signal channel.

type Option

type Option func(*Config)

An Option configures a Config.

func WithBuilder

func WithBuilder(builder BuilderFn) Option

WithBuilder sets a custom builder function for a Config.

func WithCRDPaths

func WithCRDPaths(crds ...string) Option

WithCRDPaths sets custom CRD locations for a Config.

func WithCleaners

func WithCleaners(cleaners ...CleanerFn) Option

WithCleaners sets custom cleaner functios for a Config.

func WithManagerOptions

func WithManagerOptions(m manager.Options) Option

WithManagerOptions sets custom options for the manager configured by Config.

Jump to

Keyboard shortcuts

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