athodyd

package module
v0.0.0-...-72f37a1 Latest Latest
Warning

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

Go to latest
Published: Nov 15, 2019 License: Apache-2.0 Imports: 18 Imported by: 0

README

Athodyd

Table-driven integration tests for Kubernetes controllers and CustomResourceDefinitions.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	CRDDirectoryPaths []string
	Builder           OperationFn
	Cleaner           OperationFn
	ManagerOptions    manager.Options
}

Config is a set of configuration values for Athodyd 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 Athodyd 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 Athodyd's channel.

type OperationFn

type OperationFn func(*envtest.Environment, client.Client) error

OperationFn is a function that uses a Kubernetes client to perform and operation

func NewBuilder

func NewBuilder() OperationFn

NewBuilder returns a new no-op Builder

func NewCleaner

func NewCleaner() OperationFn

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

type Option

type Option func(*Config)

An Option configures an Athodyd Config.

func WithBuilder

func WithBuilder(builder OperationFn) Option

WithBuilder sets a custom builder function for an Athodyd Config.

func WithCRDDirectoryPaths

func WithCRDDirectoryPaths(crds []string) Option

WithCRDDirectoryPaths sets custom CRD locations for an Athodyd Config.

func WithCleaner

func WithCleaner(cleaner OperationFn) Option

WithCleaner sets a custom cleaner function for an Athodyd Config.

func WithManagerOptions

func WithManagerOptions(m manager.Options) Option

WithManagerOptions sets custom options for the manager configured by Athodyd Config.

Jump to

Keyboard shortcuts

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