mocks

package
v0.0.321 Latest Latest
Warning

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

Go to latest
Published: Nov 25, 2026 License: Apache-2.0 Imports: 9 Imported by: ? modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

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 interface{}) 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