fake

package
v0.0.1 Latest Latest
Warning

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

Go to latest
Published: May 22, 2024 License: Apache-2.0 Imports: 11 Imported by: 0

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 *corev1.ObjectReference }

ClaimReferencer is a mock that implements ClaimReferencer interface.

func (*ClaimReferencer) GetClaimReference

func (m *ClaimReferencer) GetClaimReference() *corev1.ObjectReference

GetClaimReference gets the ClaimReference.

func (*ClaimReferencer) SetClaimReference

func (m *ClaimReferencer) SetClaimReference(r *corev1.ObjectReference)

SetClaimReference sets the ClaimReference.

type Composed

Composed is a mock that implements Composed interface.

func (*Composed) DeepCopyObject

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

DeepCopyObject returns a copy of the object as runtime.Object

func (*Composed) GetObjectKind

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

GetObjectKind returns schema.ObjectKind.

type ComposedResourcesReferencer

type ComposedResourcesReferencer struct{ Refs []corev1.ObjectReference }

ComposedResourcesReferencer is a mock that implements ComposedResourcesReferencer interface.

func (*ComposedResourcesReferencer) GetResourceReferences

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

GetResourceReferences gets the composed references.

func (*ComposedResourcesReferencer) SetResourceReferences

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

SetResourceReferences sets the composed references.

type Composite

Composite is a mock that implements Composite interface.

func (*Composite) DeepCopyObject

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

DeepCopyObject returns a copy of the object as runtime.Object

func (*Composite) GetObjectKind

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

GetObjectKind returns schema.ObjectKind.

type CompositeClaim

CompositeClaim is a mock that implements the CompositeClaim interface.

func (*CompositeClaim) DeepCopyObject

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

DeepCopyObject returns a copy of the object as runtime.Object

func (*CompositeClaim) GetObjectKind

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

GetObjectKind returns schema.ObjectKind.

type CompositeResourceDeleter

type CompositeResourceDeleter struct{ Policy *xpv1.CompositeDeletePolicy }

CompositeResourceDeleter is a mock that implements CompositeResourceDeleter interface.

func (*CompositeResourceDeleter) GetCompositeDeletePolicy

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

GetCompositeDeletePolicy gets the CompositeDeletePolicy.

func (*CompositeResourceDeleter) SetCompositeDeletePolicy

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

SetCompositeDeletePolicy sets the CompositeDeletePolicy.

type CompositeResourceReferencer

type CompositeResourceReferencer struct{ Ref *corev1.ObjectReference }

CompositeResourceReferencer is a mock that implements CompositeResourceReferencer interface.

func (*CompositeResourceReferencer) GetResourceReference

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

GetResourceReference gets the composite resource reference.

func (*CompositeResourceReferencer) SetResourceReference

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

SetResourceReference sets the composite resource reference.

type CompositionReferencer

type CompositionReferencer struct{ Ref *corev1.ObjectReference }

CompositionReferencer is a mock that implements CompositionReferencer interface.

func (*CompositionReferencer) GetCompositionReference

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

GetCompositionReference gets the CompositionReference.

func (*CompositionReferencer) SetCompositionReference

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

SetCompositionReference sets the CompositionReference.

type CompositionRevisionReferencer

type CompositionRevisionReferencer struct{ Ref *corev1.ObjectReference }

CompositionRevisionReferencer is a mock that implements CompositionRevisionReferencer interface.

func (*CompositionRevisionReferencer) GetCompositionRevisionReference

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

GetCompositionRevisionReference gets the CompositionRevisionReference.

func (*CompositionRevisionReferencer) SetCompositionRevisionReference

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

SetCompositionRevisionReference sets the CompositionRevisionReference.

type CompositionRevisionSelector

type CompositionRevisionSelector struct{ Sel *metav1.LabelSelector }

CompositionRevisionSelector is a mock that implements CompositionRevisionSelector interface.

func (*CompositionRevisionSelector) GetCompositionRevisionSelector

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

GetCompositionRevisionSelector gets the CompositionRevisionSelector.

func (*CompositionRevisionSelector) SetCompositionRevisionSelector

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

SetCompositionRevisionSelector sets the CompositionRevisionSelector.

type CompositionSelector

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

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

GetCompositionSelector gets the CompositionSelector.

func (*CompositionSelector) SetCompositionSelector

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

SetCompositionSelector sets the CompositionSelector.

type CompositionUpdater

type CompositionUpdater struct{ Policy *xpv1.UpdatePolicy }

CompositionUpdater is a mock that implements CompositionUpdater interface.

func (*CompositionUpdater) GetCompositionUpdatePolicy

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

GetCompositionUpdatePolicy gets the CompositionUpdatePolicy.

func (*CompositionUpdater) SetCompositionUpdatePolicy

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

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

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

GetConnectionDetailsLastPublishedTime gets the published time.

func (*ConnectionDetailsLastPublishedTimer) SetConnectionDetailsLastPublishedTime

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

SetConnectionDetailsLastPublishedTime sets the published time.

type ConnectionDetailsPublisherTo

type ConnectionDetailsPublisherTo struct {
	To *xpv1.PublishConnectionDetailsTo
}

ConnectionDetailsPublisherTo is a mock that implements ConnectionDetailsPublisherTo interface.

func (*ConnectionDetailsPublisherTo) GetPublishConnectionDetailsTo

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

GetPublishConnectionDetailsTo gets the PublishConnectionDetailsTo.

func (*ConnectionDetailsPublisherTo) SetPublishConnectionDetailsTo

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

type EnvironmentConfigReferencer struct{ Refs []corev1.ObjectReference }

An EnvironmentConfigReferencer is a mock that implements the EnvironmentConfigReferencer interface.

func (*EnvironmentConfigReferencer) GetEnvironmentConfigReferences

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

GetEnvironmentConfigReferences gets the EnvironmentConfig references.

func (*EnvironmentConfigReferencer) SetEnvironmentConfigReferences

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

type Manageable struct{ Policy xpv1.ManagementPolicy }

Manageable implements the Manageable interface.

func (*Manageable) GetManagementPolicy

func (m *Manageable) GetManagementPolicy() xpv1.ManagementPolicy

GetManagementPolicy gets the ManagementPolicy.

func (*Manageable) SetManagementPolicy

func (m *Manageable) SetManagementPolicy(p xpv1.ManagementPolicy)

SetManagementPolicy sets the ManagementPolicy.

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

	Client     client.Client
	Scheme     *runtime.Scheme
	Config     *rest.Config
	RESTMapper meta.RESTMapper
}

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

func (*Manager) Elected

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

Elected returns a closed channel.

func (*Manager) GetClient

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

GetClient returns the client.

func (*Manager) GetConfig

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

GetConfig returns the config.

func (*Manager) GetRESTMapper

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

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

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

DeepCopyObject returns a copy of the object as runtime.Object

func (*MockConnectionSecretOwner) GetObjectKind

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

GetObjectKind returns schema.ObjectKind.

func (*MockConnectionSecretOwner) GetPublishConnectionDetailsTo

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

GetPublishConnectionDetailsTo returns the publish connection details to reference.

func (*MockConnectionSecretOwner) GetWriteConnectionSecretToReference

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

GetWriteConnectionSecretToReference returns the connection secret reference.

func (*MockConnectionSecretOwner) SetPublishConnectionDetailsTo

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

SetPublishConnectionDetailsTo sets the publish connection details to reference.

func (*MockConnectionSecretOwner) SetWriteConnectionSecretToReference

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

SetWriteConnectionSecretToReference sets the connection secret reference.

type MockLocalConnectionSecretOwner

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

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

DeepCopyObject returns a copy of the object as runtime.Object

func (*MockLocalConnectionSecretOwner) GetObjectKind

GetObjectKind returns schema.ObjectKind.

func (*MockLocalConnectionSecretOwner) GetPublishConnectionDetailsTo

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

GetPublishConnectionDetailsTo returns the publish connectionDetails to.

func (*MockLocalConnectionSecretOwner) GetWriteConnectionSecretToReference

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

GetWriteConnectionSecretToReference returns the connection secret reference.

func (*MockLocalConnectionSecretOwner) SetPublishConnectionDetailsTo

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

SetPublishConnectionDetailsTo sets the publish connectionDetails to

func (*MockLocalConnectionSecretOwner) SetWriteConnectionSecretToReference

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

type Orphanable struct{ Policy xpv1.DeletionPolicy }

Orphanable implements the Orphanable interface.

func (*Orphanable) GetDeletionPolicy

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

GetDeletionPolicy gets the DeletionPolicy.

func (*Orphanable) SetDeletionPolicy

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

SetDeletionPolicy sets the DeletionPolicy.

type ProviderConfig

type ProviderConfig struct {
	metav1.ObjectMeta

	UserCounter
	xpv1.ConditionedStatus
}

ProviderConfig is a mock implementation of the ProviderConfig interface.

func (*ProviderConfig) DeepCopyObject

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

DeepCopyObject returns a copy of the object as runtime.Object

func (*ProviderConfig) GetObjectKind

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

GetObjectKind returns schema.ObjectKind.

type ProviderConfigReferencer

type ProviderConfigReferencer struct{ Ref *xpv1.Reference }

ProviderConfigReferencer is a mock that implements ProviderConfigReferencer interface.

func (*ProviderConfigReferencer) GetProviderConfigReference

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

GetProviderConfigReference gets the ProviderConfigReference.

func (*ProviderConfigReferencer) SetProviderConfigReference

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

SetProviderConfigReference sets the ProviderConfigReference.

type ProviderConfigUsage

ProviderConfigUsage is a mock implementation of the ProviderConfigUsage interface.

func (*ProviderConfigUsage) DeepCopyObject

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

DeepCopyObject returns a copy of the object as runtime.Object

func (*ProviderConfigUsage) GetObjectKind

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

GetObjectKind returns schema.ObjectKind.

type ProviderReferencer

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

ProviderReferencer is a mock that implements ProviderReferencer interface.

func (*ProviderReferencer) GetProviderReference

func (m *ProviderReferencer) GetProviderReference() *xpv1.Reference

GetProviderReference gets the ProviderReference.

func (*ProviderReferencer) SetProviderReference

func (m *ProviderReferencer) SetProviderReference(p *xpv1.Reference)

SetProviderReference sets the ProviderReference.

type RequiredProviderConfigReferencer

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

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

GetProviderConfigReference gets the ProviderConfigReference.

func (*RequiredProviderConfigReferencer) SetProviderConfigReference

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

SetProviderConfigReference sets the ProviderConfigReference.

type RequiredTypedResourceReferencer

type RequiredTypedResourceReferencer struct{ Ref xpv1.TypedReference }

RequiredTypedResourceReferencer is a mock that implements the RequiredTypedResourceReferencer interface.

func (*RequiredTypedResourceReferencer) GetResourceReference

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

GetResourceReference gets the ResourceReference.

func (*RequiredTypedResourceReferencer) SetResourceReference

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

SetResourceReference sets the ResourceReference.

type UserCounter

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

func (m *UserCounter) GetUsers() int64

GetUsers gets the count of users.

func (*UserCounter) SetUsers

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