Documentation ¶
Overview ¶
Package fakes defines methods for instantiating objects which act like resources on a Kubernetes cluster, but are not intended to actually be instantiated on a real, production cluster.
The primary purpose of these objects is to aid writing tests, but that is not this package's only purpose. These objects are also used in debugging logic which is compiled in to production code.
Index ¶
Constants ¶
const ( // Name is the default name given to fake objects. Name = "foo" // Namespace is the default namespace given to fake namespace-scoped objects. Namespace = "bar" // UID is the default UID given to fake objects. UID = "abcd" )
const (
// ExternalDataProviderName is the name of the fake external data provider.
ExternalDataProviderName = "test-provider"
)
Variables ¶
var ExternalDataProviderCache = frameworksexternaldata.NewCache()
ExternalDataProviderCache is the cache of external data providers.
Functions ¶
Types ¶
type Opt ¶
Opt modifies a client.Object during object instantiation. Generally, if there are conflicting opts (such as two WithName calls), the latter should win. This allows objects to have defaults which can easily be overridden.
func WithLabels ¶
WithLabels sets the metadata.labels of the object. Overwrites any existing labels on the object.
func WithNamespace ¶
WithNamespace sets the metadata.namespace of the object.