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 ¶
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 ¶
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 ¶
NewManager creates a Manager wired to the given fake client.
func (*Manager) GetCluster ¶
func (m *Manager) GetCluster(_ context.Context, _ multicluster.ClusterName) (cluster.Cluster, error)
GetCluster returns the configured test cluster regardless of clusterName.