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.