testfakes

package
v0.2.8 Latest Latest
Warning

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

Go to latest
Published: Sep 29, 2026 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Overview

Package testfakes provides shared fake implementations for unit testing controllers that depend on multicluster-runtime manager and cluster interfaces.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewRequest

func NewRequest(clusterName, namespace, name string) mcreconcile.Request

NewRequest builds a multicluster reconcile.Request for use in unit tests.

Types

type FakeCluster

type FakeCluster struct {
	cluster.Cluster
	C client.Client
}

FakeCluster is a minimal fake cluster.Cluster for unit tests. It embeds the full interface; only GetClient is implemented.

func (*FakeCluster) GetClient

func (c *FakeCluster) GetClient() client.Client

GetClient returns the injected test client.

type Manager

type Manager struct {
	mcmanager.Manager
	FakeCluster cluster.Cluster
}

Manager is a minimal fake mcmanager.Manager for unit tests. It embeds the full interface so that only GetCluster needs to be implemented. Any call to an unimplemented method will panic — this is intentional and surfaces accidental dependencies in tests.

func NewManager

func NewManager(c client.Client) *Manager

NewManager creates a Manager wired to the given fake client.

func (*Manager) GetCluster

GetCluster returns the configured test cluster regardless of clusterName.

Jump to

Keyboard shortcuts

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