fake

package
v1.12.0-rc.1 Latest Latest
Warning

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

Go to latest
Published: Dec 4, 2024 License: Apache-2.0 Imports: 18 Imported by: 0

Documentation

Overview

Package fake contains fake context objects for testing.

Index

Constants

View Source
const (
	// ControllerName is the name of the fake controller.
	ControllerName = "fake-controller"

	// ControllerManagerName is the name of the fake controller manager.
	ControllerManagerName = "fake-controller-manager"

	// ControllerManagerNamespace is the name of the namespace in which the
	// fake controller manager's resources are located.
	ControllerManagerNamespace = "fake-capv-system"

	// LeaderElectionNamespace is the namespace used to control leader election
	// for the fake controller manager.
	LeaderElectionNamespace = ControllerManagerNamespace

	// LeaderElectionID is the name of the ID used to control leader election
	// for the fake controller manager.
	LeaderElectionID = ControllerManagerName + "-runtime"

	// Namespace is the fake namespace.
	Namespace = "default"

	// ClusterUUID is the UID of the fake CAPI cluster.
	ClusterUUID = "00000000-0000-0000-0000-000000000002"

	// Clusterv1a2Name is the name of the fake CAPI v1alpha3 Cluster resource.
	Clusterv1a2Name = "fake-cluster"

	// Clusterv1a2UUID is the UID of the fake CAPI v1alpha3 Cluster resource.
	Clusterv1a2UUID = "00000000-0000-0000-0000-000000000000"

	// InfrastructureRefName is the name of the InfrastructureRef in fake CAPI Cluster resource.
	InfrastructureRefName = "fake-cluster-infrastructure-ref"

	VSphereClusterName = "fake-vsphere-cluster"

	// VSphereClusterUUID is the UID of the fake VSphereCluster resource.
	VSphereClusterUUID = "10000000-0000-0000-0000-000000000000"

	// VSphereMachineUUID is the UID of the fake VSphereMachine resource.
	VSphereMachineUUID = "10000000-0000-0000-0000-000000000001"

	// VSphereVMName is the name of the fake VSphereVM resource.
	VSphereVMName = "fake-vm"

	// VSphereVMUUID is the UID of the fake VSphereVMUUID resource.
	VSphereVMUUID = "20000000-0000-0000-0000-000000000002"

	// PodCIDR is the CIDR for the pod network.
	PodCIDR = "1.0.0.0/16"

	// ServiceCIDR is the CIDR for the service network.
	ServiceCIDR = "2.0.0.0/16"

	VCenterURL = "foo.vcenter.com"
)

Variables

This section is empty.

Functions

func NewClusterContext

func NewClusterContext(ctx context.Context, controllerManagerCtx *capvcontext.ControllerManagerContext) *capvcontext.ClusterContext

NewClusterContext returns a fake ClusterContext for unit testing reconcilers with a fake client.

func NewControllerManagerContext

func NewControllerManagerContext(initObjects ...client.Object) *capvcontext.ControllerManagerContext

func NewFakeGuestClusterClient added in v1.1.0

func NewFakeGuestClusterClient(initObjects ...client.Object) client.Client

func NewGuestClusterContext added in v1.1.0

func NewGuestClusterContext(ctx context.Context, clusterCtx *vmware.ClusterContext, controllerManagerCtx *capvcontext.ControllerManagerContext, prototypeCluster bool, gcInitObjects ...client.Object) *vmware.GuestClusterContext

NewGuestClusterContext returns a fake GuestClusterContext for unit testing guest cluster controllers with a fake client.

func NewMachineContext

func NewMachineContext(ctx context.Context, clusterCtx *capvcontext.ClusterContext, controllerManagerCtx *capvcontext.ControllerManagerContext) *capvcontext.VIMMachineContext

NewMachineContext returns a fake VIMMachineContext for unit testing reconcilers with a fake client.

func NewVMContext added in v0.6.0

func NewVMContext(ctx context.Context, controllerManagerCtx *capvcontext.ControllerManagerContext) *capvcontext.VMContext

NewVMContext returns a fake VMContext for unit testing reconcilers with a fake client.

func NewVSphereCluster added in v1.1.0

func NewVSphereCluster(namespace string) vmwarev1.VSphereCluster

func NewVmwareClusterContext added in v1.1.0

func NewVmwareClusterContext(ctx context.Context, controllerManagerCtx *capvcontext.ControllerManagerContext, namespace string, vsphereCluster *vmwarev1.VSphereCluster) *vmware.ClusterContext

NewVmwareClusterContext returns a fake ClusterContext for unit testing reconcilers with a fake client.

Types

This section is empty.

Jump to

Keyboard shortcuts

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