testing

package
v0.0.0-...-70b330c Latest Latest
Warning

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

Go to latest
Published: Jul 19, 2022 License: Apache-2.0 Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GenerateReactor

func GenerateReactor(fn ChainedMockFunction) k8testing.ReactionFunc

GenerateReactor generates a reaction function that can be used in Kubernetes fake implementations. The fn function performs the actual reaction operation. This function can short circuit the reactor chain by way of the handled return value.

Types

type ChainedMockFunction

type ChainedMockFunction func(args ...interface{}) (handled bool, res interface{})

ChainedMockFunction is a generic function used to create Kubernetes Reactor chains. Reactor chains allows modifying resources in response to events. ChainedMockFunction differs from MockFunction in that it returns a `handled` value, which lets the reactor chain short circuit if necessary.

func GenerateObjectReturnChainedMock

func GenerateObjectReturnChainedMock(handled bool, res interface{}) ChainedMockFunction

GenerateObjectReturnChainedMock is a helper function to generate a ChainedMockFunction that returns a provided object without performing any additional operations. Typically used to return a specific value for a set of Kubernetes fake verb and resource combination.

Jump to

Keyboard shortcuts

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