mocks

package
v0.0.245 Latest Latest
Warning

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

Go to latest
Published: Apr 19, 2023 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetInvalidResources

func GetInvalidResources(t testing.TB) []map[string]interface{}

GetInvalidResources fetches examples of invalid resource definitions.

func GetResourceByType

func GetResourceByType(t testing.TB, desiredType string, opts ...Option) map[string]interface{}

GetResourceByType fetches a resource of the desired type from the resources mock fixture.

For the moment, only 1 mock is available for each resource type.

Types

type Option

type Option func(map[string]interface{})

func WithDesiredNumberScheduled

func WithDesiredNumberScheduled(desired int32) Option

WithDesiredNumberScheduled overrides the desired number scheduled in the status section, if any.

func WithID

func WithID(name string) Option

WithID overrides the ID of a mock resource

func WithName

func WithName(name string) Option

WithName overrides the name of a mock resource

func WithRelatedObjects

func WithRelatedObjects(related ...map[string]interface{}) Option

WithRelatedObjects adds related objects to the mocked object.

func WithReplicas

func WithReplicas(replicas int) Option

WithReplicas overrides the replicas in the mock "spec" section, if any.

Jump to

Keyboard shortcuts

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