fake

package
v1.15.1 Latest Latest
Warning

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

Go to latest
Published: Feb 21, 2024 License: Apache-2.0 Imports: 14 Imported by: 3

Documentation

Overview

Package fake provides fake Crossplane resources for use in tests.

Index

Constants

This section is empty.

Variables

View Source
var GV = schema.GroupVersion{Group: "g", Version: "v"}

GV returns a mock schema.GroupVersion.

Functions

func GVK

GVK returns the mock GVK of the given object.

func SchemeWith

func SchemeWith(o ...runtime.Object) *runtime.Scheme

SchemeWith returns a scheme with list of `runtime.Object`s registered.

Types

type ClaimReferencer

type ClaimReferencer struct{ Ref *claim.Reference }

ClaimReferencer is a mock that implements ClaimReferencer interface.

func (*ClaimReferencer) GetClaimReference

func (m *ClaimReferencer) GetClaimReference() *claim.Reference

GetClaimReference gets the ClaimReference.

func (*ClaimReferencer) SetClaimReference

func (m *ClaimReferencer) SetClaimReference(r *claim.Reference)

SetClaimReference sets the ClaimReference.

type Composed added in v0.8.0

Composed is a mock that implements Composed interface.

func (*Composed) DeepCopyObject added in v0.8.0

func (m *Composed) DeepCopyObject() runtime.Object

DeepCopyObject returns a copy of the object as runtime.Object

func (*Composed) GetObjectKind added in v0.8.0

func (m *Composed) GetObjectKind() schema.ObjectKind

GetObjectKind returns schema.ObjectKind.

type ComposedResourcesReferencer added in v0.8.0

type ComposedResourcesReferencer struct{ Refs []corev1.ObjectReference }

ComposedResourcesReferencer is a mock that implements ComposedResourcesReferencer interface.

func (*ComposedResourcesReferencer) GetResourceReferences added in v0.8.0

func (m *ComposedResourcesReferencer) GetResourceReferences() []corev1.ObjectReference

GetResourceReferences gets the composed references.

func (*ComposedResourcesReferencer) SetResourceReferences added in v0.8.0

func (m *ComposedResourcesReferencer) SetResourceReferences(r []corev1.ObjectReference)

SetResourceReferences sets the composed references.

type Composite added in v0.8.0

Composite is a mock that implements Composite interface.

func (*Composite) DeepCopyObject added in v0.8.0

func (m *Composite) DeepCopyObject() runtime.Object

DeepCopyObject returns a copy of the object as runtime.Object

func (*Composite) GetObjectKind added in v0.8.0

func (m *Composite) GetObjectKind() schema.ObjectKind

GetObjectKind returns schema.ObjectKind.

type CompositeClaim added in v0.10.0

CompositeClaim is a mock that implements the CompositeClaim interface.

func (*CompositeClaim) DeepCopyObject added in v0.10.0

func (m *CompositeClaim) DeepCopyObject() runtime.Object

DeepCopyObject returns a copy of the object as runtime.Object

func (*CompositeClaim) GetObjectKind added in v0.10.0

func (m *CompositeClaim) GetObjectKind() schema.ObjectKind

GetObjectKind returns schema.ObjectKind.

type CompositeResourceDeleter added in v0.19.0

type CompositeResourceDeleter struct{ Policy *xpv1.CompositeDeletePolicy }

CompositeResourceDeleter is a mock that implements CompositeResourceDeleter interface.

func (*CompositeResourceDeleter) GetCompositeDeletePolicy added in v0.19.0

func (m *CompositeResourceDeleter) GetCompositeDeletePolicy() *xpv1.CompositeDeletePolicy

GetCompositeDeletePolicy gets the CompositeDeletePolicy.

func (*CompositeResourceDeleter) SetCompositeDeletePolicy added in v0.19.0

func (m *CompositeResourceDeleter) SetCompositeDeletePolicy(p *xpv1.CompositeDeletePolicy)

SetCompositeDeletePolicy sets the CompositeDeletePolicy.

type CompositeResourceReferencer added in v0.8.0

type CompositeResourceReferencer struct{ Ref *corev1.ObjectReference }

CompositeResourceReferencer is a mock that implements CompositeResourceReferencer interface.

func (*CompositeResourceReferencer) GetResourceReference added in v0.8.0

func (m *CompositeResourceReferencer) GetResourceReference() *corev1.ObjectReference

GetResourceReference gets the composite resource reference.

func (*CompositeResourceReferencer) SetResourceReference added in v0.8.0

func (m *CompositeResourceReferencer) SetResourceReference(p *corev1.ObjectReference)

SetResourceReference sets the composite resource reference.

type CompositionReferencer added in v0.8.0

type CompositionReferencer struct{ Ref *corev1.ObjectReference }

CompositionReferencer is a mock that implements CompositionReferencer interface.

func (*CompositionReferencer) GetCompositionReference added in v0.8.0

func (m *CompositionReferencer) GetCompositionReference() *corev1.ObjectReference

GetCompositionReference gets the CompositionReference.

func (*CompositionReferencer) SetCompositionReference added in v0.8.0

func (m *CompositionReferencer) SetCompositionReference(r *corev1.ObjectReference)

SetCompositionReference sets the CompositionReference.

type CompositionRevisionReferencer added in v0.15.0

type CompositionRevisionReferencer struct{ Ref *corev1.ObjectReference }

CompositionRevisionReferencer is a mock that implements CompositionRevisionReferencer interface.

func (*CompositionRevisionReferencer) GetCompositionRevisionReference added in v0.15.0

func (m *CompositionRevisionReferencer) GetCompositionRevisionReference() *corev1.ObjectReference

GetCompositionRevisionReference gets the CompositionRevisionReference.

func (*CompositionRevisionReferencer) SetCompositionRevisionReference added in v0.15.0

func (m *CompositionRevisionReferencer) SetCompositionRevisionReference(r *corev1.ObjectReference)

SetCompositionRevisionReference sets the CompositionRevisionReference.

type CompositionRevisionSelector added in v0.19.0

type CompositionRevisionSelector struct{ Sel *metav1.LabelSelector }

CompositionRevisionSelector is a mock that implements CompositionRevisionSelector interface.

func (*CompositionRevisionSelector) GetCompositionRevisionSelector added in v0.19.0

func (m *CompositionRevisionSelector) GetCompositionRevisionSelector() *metav1.LabelSelector

GetCompositionRevisionSelector gets the CompositionRevisionSelector.

func (*CompositionRevisionSelector) SetCompositionRevisionSelector added in v0.19.0

func (m *CompositionRevisionSelector) SetCompositionRevisionSelector(ls *metav1.LabelSelector)

SetCompositionRevisionSelector sets the CompositionRevisionSelector.

type CompositionSelector added in v0.8.0

type CompositionSelector struct{ Sel *metav1.LabelSelector } //nolint:musttag // This is a fake implementation to be used in unit tests only.

CompositionSelector is a mock that implements CompositionSelector interface.

func (*CompositionSelector) GetCompositionSelector added in v0.8.0

func (m *CompositionSelector) GetCompositionSelector() *metav1.LabelSelector

GetCompositionSelector gets the CompositionSelector.

func (*CompositionSelector) SetCompositionSelector added in v0.8.0

func (m *CompositionSelector) SetCompositionSelector(s *metav1.LabelSelector)

SetCompositionSelector sets the CompositionSelector.

type CompositionUpdater added in v0.15.0

type CompositionUpdater struct{ Policy *xpv1.UpdatePolicy }

CompositionUpdater is a mock that implements CompositionUpdater interface.

func (*CompositionUpdater) GetCompositionUpdatePolicy added in v0.15.0

func (m *CompositionUpdater) GetCompositionUpdatePolicy() *xpv1.UpdatePolicy

GetCompositionUpdatePolicy gets the CompositionUpdatePolicy.

func (*CompositionUpdater) SetCompositionUpdatePolicy added in v0.15.0

func (m *CompositionUpdater) SetCompositionUpdatePolicy(p *xpv1.UpdatePolicy)

SetCompositionUpdatePolicy sets the CompositionUpdatePolicy.

type Conditioned

type Conditioned struct{ Conditions []xpv1.Condition }

Conditioned is a mock that implements Conditioned interface.

func (*Conditioned) GetCondition

func (m *Conditioned) GetCondition(ct xpv1.ConditionType) xpv1.Condition

GetCondition get the Condition with the given ConditionType.

func (*Conditioned) SetConditions

func (m *Conditioned) SetConditions(c ...xpv1.Condition)

SetConditions sets the Conditions.

type ConnectionDetailsLastPublishedTimer added in v0.11.0

type ConnectionDetailsLastPublishedTimer struct {
	// NOTE: runtime.DefaultUnstructuredConverter.ToUnstructured
	// cannot currently handle if `Time` is nil here.
	// The `omitempty` json tag is a workaround that
	// prevents a panic.
	Time *metav1.Time `json:"lastPublishedTime,omitempty"`
}

ConnectionDetailsLastPublishedTimer is a mock that implements the ConnectionDetailsLastPublishedTimer interface.

func (*ConnectionDetailsLastPublishedTimer) GetConnectionDetailsLastPublishedTime added in v0.11.0

func (c *ConnectionDetailsLastPublishedTimer) GetConnectionDetailsLastPublishedTime() *metav1.Time

GetConnectionDetailsLastPublishedTime gets the published time.

func (*ConnectionDetailsLastPublishedTimer) SetConnectionDetailsLastPublishedTime added in v0.11.0

func (c *ConnectionDetailsLastPublishedTimer) SetConnectionDetailsLastPublishedTime(t *metav1.Time)

SetConnectionDetailsLastPublishedTime sets the published time.

type ConnectionDetailsPublisherTo added in v0.16.0

type ConnectionDetailsPublisherTo struct {
	To *xpv1.PublishConnectionDetailsTo
}

ConnectionDetailsPublisherTo is a mock that implements ConnectionDetailsPublisherTo interface.

func (*ConnectionDetailsPublisherTo) GetPublishConnectionDetailsTo added in v0.16.0

func (m *ConnectionDetailsPublisherTo) GetPublishConnectionDetailsTo() *xpv1.PublishConnectionDetailsTo

GetPublishConnectionDetailsTo gets the PublishConnectionDetailsTo.

func (*ConnectionDetailsPublisherTo) SetPublishConnectionDetailsTo added in v0.16.0

func (m *ConnectionDetailsPublisherTo) SetPublishConnectionDetailsTo(to *xpv1.PublishConnectionDetailsTo)

SetPublishConnectionDetailsTo sets the PublishConnectionDetailsTo.

type ConnectionSecretWriterTo

type ConnectionSecretWriterTo struct{ Ref *xpv1.SecretReference } //nolint:musttag // This is a fake implementation to be used in unit tests only.

ConnectionSecretWriterTo is a mock that implements ConnectionSecretWriterTo interface.

func (*ConnectionSecretWriterTo) GetWriteConnectionSecretToReference

func (m *ConnectionSecretWriterTo) GetWriteConnectionSecretToReference() *xpv1.SecretReference

GetWriteConnectionSecretToReference gets the WriteConnectionSecretToReference.

func (*ConnectionSecretWriterTo) SetWriteConnectionSecretToReference

func (m *ConnectionSecretWriterTo) SetWriteConnectionSecretToReference(r *xpv1.SecretReference)

SetWriteConnectionSecretToReference sets the WriteConnectionSecretToReference.

type EnvironmentConfigReferencer added in v0.18.0

type EnvironmentConfigReferencer struct{ Refs []corev1.ObjectReference }

An EnvironmentConfigReferencer is a mock that implements the EnvironmentConfigReferencer interface.

func (*EnvironmentConfigReferencer) GetEnvironmentConfigReferences added in v0.18.0

func (m *EnvironmentConfigReferencer) GetEnvironmentConfigReferences() []corev1.ObjectReference

GetEnvironmentConfigReferences gets the EnvironmentConfig references.

func (*EnvironmentConfigReferencer) SetEnvironmentConfigReferences added in v0.18.0

func (m *EnvironmentConfigReferencer) SetEnvironmentConfigReferences(refs []corev1.ObjectReference)

SetEnvironmentConfigReferences sets the EnvironmentConfig references.

type LocalConnectionSecretWriterTo

type LocalConnectionSecretWriterTo struct {
	Ref *xpv1.LocalSecretReference
}

LocalConnectionSecretWriterTo is a mock that implements LocalConnectionSecretWriterTo interface.

func (*LocalConnectionSecretWriterTo) GetWriteConnectionSecretToReference

func (m *LocalConnectionSecretWriterTo) GetWriteConnectionSecretToReference() *xpv1.LocalSecretReference

GetWriteConnectionSecretToReference gets the WriteConnectionSecretToReference.

func (*LocalConnectionSecretWriterTo) SetWriteConnectionSecretToReference

func (m *LocalConnectionSecretWriterTo) SetWriteConnectionSecretToReference(r *xpv1.LocalSecretReference)

SetWriteConnectionSecretToReference sets the WriteConnectionSecretToReference.

type Manageable added in v0.20.0

type Manageable struct{ Policy xpv1.ManagementPolicies }

Manageable implements the Manageable interface.

func (*Manageable) GetManagementPolicies added in v0.20.0

func (m *Manageable) GetManagementPolicies() xpv1.ManagementPolicies

GetManagementPolicies gets the ManagementPolicies.

func (*Manageable) SetManagementPolicies added in v0.20.0

func (m *Manageable) SetManagementPolicies(p xpv1.ManagementPolicies)

SetManagementPolicies sets the ManagementPolicies.

type Managed

Managed is a mock that implements Managed interface.

func (*Managed) DeepCopyObject

func (m *Managed) DeepCopyObject() runtime.Object

DeepCopyObject returns a copy of the object as runtime.Object

func (*Managed) GetObjectKind

func (m *Managed) GetObjectKind() schema.ObjectKind

GetObjectKind returns schema.ObjectKind.

type ManagedResourceReferencer

type ManagedResourceReferencer struct{ Ref *corev1.ObjectReference }

ManagedResourceReferencer is a mock that implements ManagedResourceReferencer interface.

func (*ManagedResourceReferencer) GetResourceReference

func (m *ManagedResourceReferencer) GetResourceReference() *corev1.ObjectReference

GetResourceReference gets the ResourceReference.

func (*ManagedResourceReferencer) SetResourceReference

func (m *ManagedResourceReferencer) SetResourceReference(r *corev1.ObjectReference)

SetResourceReference sets the ResourceReference.

type Manager

type Manager struct {
	manager.Manager

	Cache      cache.Cache
	Client     client.Client
	Scheme     *runtime.Scheme
	Config     *rest.Config
	RESTMapper meta.RESTMapper
	Logger     logr.Logger
}

Manager is a mock object that satisfies manager.Manager interface.

func (*Manager) Elected added in v0.8.0

func (m *Manager) Elected() <-chan struct{}

Elected returns a closed channel.

func (*Manager) GetCache added in v1.14.0

func (m *Manager) GetCache() cache.Cache

GetCache returns the cache.

func (*Manager) GetClient

func (m *Manager) GetClient() client.Client

GetClient returns the client.

func (*Manager) GetConfig added in v0.8.0

func (m *Manager) GetConfig() *rest.Config

GetConfig returns the config.

func (*Manager) GetLogger added in v0.20.0

func (m *Manager) GetLogger() logr.Logger

GetLogger returns the logger.

func (*Manager) GetRESTMapper added in v0.8.0

func (m *Manager) GetRESTMapper() meta.RESTMapper

GetRESTMapper returns the REST mapper.

func (*Manager) GetScheme

func (m *Manager) GetScheme() *runtime.Scheme

GetScheme returns the scheme.

type MockConnectionSecretOwner added in v0.8.0

type MockConnectionSecretOwner struct {
	runtime.Object
	metav1.ObjectMeta

	To       *xpv1.PublishConnectionDetailsTo
	WriterTo *xpv1.SecretReference
}

MockConnectionSecretOwner is a mock object that satisfies ConnectionSecretOwner interface.

func (*MockConnectionSecretOwner) DeepCopyObject added in v0.8.0

func (m *MockConnectionSecretOwner) DeepCopyObject() runtime.Object

DeepCopyObject returns a copy of the object as runtime.Object

func (*MockConnectionSecretOwner) GetObjectKind added in v0.8.0

func (m *MockConnectionSecretOwner) GetObjectKind() schema.ObjectKind

GetObjectKind returns schema.ObjectKind.

func (*MockConnectionSecretOwner) GetPublishConnectionDetailsTo added in v0.16.0

func (m *MockConnectionSecretOwner) GetPublishConnectionDetailsTo() *xpv1.PublishConnectionDetailsTo

GetPublishConnectionDetailsTo returns the publish connection details to reference.

func (*MockConnectionSecretOwner) GetWriteConnectionSecretToReference added in v0.8.0

func (m *MockConnectionSecretOwner) GetWriteConnectionSecretToReference() *xpv1.SecretReference

GetWriteConnectionSecretToReference returns the connection secret reference.

func (*MockConnectionSecretOwner) SetPublishConnectionDetailsTo added in v0.16.0

func (m *MockConnectionSecretOwner) SetPublishConnectionDetailsTo(t *xpv1.PublishConnectionDetailsTo)

SetPublishConnectionDetailsTo sets the publish connection details to reference.

func (*MockConnectionSecretOwner) SetWriteConnectionSecretToReference added in v0.8.0

func (m *MockConnectionSecretOwner) SetWriteConnectionSecretToReference(r *xpv1.SecretReference)

SetWriteConnectionSecretToReference sets the connection secret reference.

type MockLocalConnectionSecretOwner added in v0.8.0

type MockLocalConnectionSecretOwner struct {
	runtime.Object
	metav1.ObjectMeta

	Ref *xpv1.LocalSecretReference
	To  *xpv1.PublishConnectionDetailsTo
}

MockLocalConnectionSecretOwner is a mock object that satisfies LocalConnectionSecretOwner interface.

func (*MockLocalConnectionSecretOwner) DeepCopyObject added in v0.8.0

func (m *MockLocalConnectionSecretOwner) DeepCopyObject() runtime.Object

DeepCopyObject returns a copy of the object as runtime.Object

func (*MockLocalConnectionSecretOwner) GetObjectKind added in v0.8.0

GetObjectKind returns schema.ObjectKind.

func (*MockLocalConnectionSecretOwner) GetPublishConnectionDetailsTo added in v0.16.0

func (m *MockLocalConnectionSecretOwner) GetPublishConnectionDetailsTo() *xpv1.PublishConnectionDetailsTo

GetPublishConnectionDetailsTo returns the publish connectionDetails to.

func (*MockLocalConnectionSecretOwner) GetWriteConnectionSecretToReference added in v0.8.0

func (m *MockLocalConnectionSecretOwner) GetWriteConnectionSecretToReference() *xpv1.LocalSecretReference

GetWriteConnectionSecretToReference returns the connection secret reference.

func (*MockLocalConnectionSecretOwner) SetPublishConnectionDetailsTo added in v0.16.0

func (m *MockLocalConnectionSecretOwner) SetPublishConnectionDetailsTo(r *xpv1.PublishConnectionDetailsTo)

SetPublishConnectionDetailsTo sets the publish connectionDetails to

func (*MockLocalConnectionSecretOwner) SetWriteConnectionSecretToReference added in v0.8.0

func (m *MockLocalConnectionSecretOwner) SetWriteConnectionSecretToReference(r *xpv1.LocalSecretReference)

SetWriteConnectionSecretToReference sets the connection secret reference.

type Object

type Object struct {
	metav1.ObjectMeta
	runtime.Object
}

Object is a mock that implements Object interface.

func (*Object) DeepCopyObject

func (o *Object) DeepCopyObject() runtime.Object

DeepCopyObject returns a copy of the object as runtime.Object

func (*Object) GetObjectKind

func (o *Object) GetObjectKind() schema.ObjectKind

GetObjectKind returns schema.ObjectKind.

type Orphanable added in v0.10.0

type Orphanable struct{ Policy xpv1.DeletionPolicy }

Orphanable implements the Orphanable interface.

func (*Orphanable) GetDeletionPolicy added in v0.10.0

func (m *Orphanable) GetDeletionPolicy() xpv1.DeletionPolicy

GetDeletionPolicy gets the DeletionPolicy.

func (*Orphanable) SetDeletionPolicy added in v0.10.0

func (m *Orphanable) SetDeletionPolicy(p xpv1.DeletionPolicy)

SetDeletionPolicy sets the DeletionPolicy.

type ProviderConfig added in v0.10.0

type ProviderConfig struct {
	metav1.ObjectMeta

	UserCounter
	xpv1.ConditionedStatus
}

ProviderConfig is a mock implementation of the ProviderConfig interface.

func (*ProviderConfig) DeepCopyObject added in v0.10.0

func (p *ProviderConfig) DeepCopyObject() runtime.Object

DeepCopyObject returns a copy of the object as runtime.Object

func (*ProviderConfig) GetObjectKind added in v0.10.0

func (p *ProviderConfig) GetObjectKind() schema.ObjectKind

GetObjectKind returns schema.ObjectKind.

type ProviderConfigReferencer added in v0.10.0

type ProviderConfigReferencer struct{ Ref *xpv1.Reference } //nolint:musttag // This is a fake implementation to be used in unit tests only.

ProviderConfigReferencer is a mock that implements ProviderConfigReferencer interface.

func (*ProviderConfigReferencer) GetProviderConfigReference added in v0.10.0

func (m *ProviderConfigReferencer) GetProviderConfigReference() *xpv1.Reference

GetProviderConfigReference gets the ProviderConfigReference.

func (*ProviderConfigReferencer) SetProviderConfigReference added in v0.10.0

func (m *ProviderConfigReferencer) SetProviderConfigReference(p *xpv1.Reference)

SetProviderConfigReference sets the ProviderConfigReference.

type ProviderConfigUsage added in v0.10.0

ProviderConfigUsage is a mock implementation of the ProviderConfigUsage interface.

func (*ProviderConfigUsage) DeepCopyObject added in v0.10.0

func (p *ProviderConfigUsage) DeepCopyObject() runtime.Object

DeepCopyObject returns a copy of the object as runtime.Object

func (*ProviderConfigUsage) GetObjectKind added in v0.10.0

func (p *ProviderConfigUsage) GetObjectKind() schema.ObjectKind

GetObjectKind returns schema.ObjectKind.

type RequiredProviderConfigReferencer added in v0.10.0

type RequiredProviderConfigReferencer struct{ Ref xpv1.Reference } //nolint:musttag // This is a fake implementation to be used in unit tests only.

RequiredProviderConfigReferencer is a mock that implements the RequiredProviderConfigReferencer interface.

func (*RequiredProviderConfigReferencer) GetProviderConfigReference added in v0.10.0

func (m *RequiredProviderConfigReferencer) GetProviderConfigReference() xpv1.Reference

GetProviderConfigReference gets the ProviderConfigReference.

func (*RequiredProviderConfigReferencer) SetProviderConfigReference added in v0.10.0

func (m *RequiredProviderConfigReferencer) SetProviderConfigReference(p xpv1.Reference)

SetProviderConfigReference sets the ProviderConfigReference.

type RequiredTypedResourceReferencer added in v0.10.0

type RequiredTypedResourceReferencer struct{ Ref xpv1.TypedReference }

RequiredTypedResourceReferencer is a mock that implements the RequiredTypedResourceReferencer interface.

func (*RequiredTypedResourceReferencer) GetResourceReference added in v0.10.0

func (m *RequiredTypedResourceReferencer) GetResourceReference() xpv1.TypedReference

GetResourceReference gets the ResourceReference.

func (*RequiredTypedResourceReferencer) SetResourceReference added in v0.10.0

func (m *RequiredTypedResourceReferencer) SetResourceReference(p xpv1.TypedReference)

SetResourceReference sets the ResourceReference.

type UserCounter added in v0.10.0

type UserCounter struct{ Users int64 } //nolint:musttag // This is a fake implementation to be used in unit tests only.

UserCounter is a mock that satisfies UserCounter interface.

func (*UserCounter) GetUsers added in v0.10.0

func (m *UserCounter) GetUsers() int64

GetUsers gets the count of users.

func (*UserCounter) SetUsers added in v0.10.0

func (m *UserCounter) SetUsers(i int64)

SetUsers sets the count of users.

Jump to

Keyboard shortcuts

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