commonarea

package
v1.5.0 Latest Latest
Warning

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

Go to latest
Published: Jan 21, 2022 License: Apache-2.0 Imports: 28 Imported by: 0

Documentation

Overview

package commonarea is a generated GoMock package.

package commonarea is a generated GoMock package.

Index

Constants

View Source
const (
	TimestampAnnotationKey = "touch-ts"
)

Variables

View Source
var (
	ReasonDisconnected       = "Disconnected"
	ReasonElectionInProgress = "LeaderElectionInProgress"
)

Functions

This section is empty.

Types

type CommonArea

type CommonArea interface {
	// Client grants read/write to the namespace of the cluster that is backing this CommonArea.
	client.Client

	// GetClusterID returns the clusterID of the cluster accessed by this CommonArea.
	GetClusterID() common.ClusterID

	// GetNamespace returns the Namespace backing this CommonArea.
	GetNamespace() string
}

CommonArea is an interface that provides access to the common area of a ClusterSet. Common Area of a ClusterSet is a Namespace in the leader cluster.

func NewRemoteCommonArea

func NewRemoteCommonArea(clusterID common.ClusterID, clusterSetID common.ClusterSetID, url string, secret *v1.Secret,
	scheme *runtime.Scheme, localClusterClient client.Client, remoteCommonAreaManager RemoteCommonAreaManager,
	clusterSetNamespace string) (CommonArea, error)

NewRemoteCommonArea returns a RemoteCommonArea instance which will use access credentials from the Secret to connect to the leader cluster's CommonArea.

type LeaderElector

type LeaderElector interface {
	// RunLeaderElection runs leader election. It is invoked periodically on a timer.
	RunLeaderElection()
}

type MockRemoteCommonArea

type MockRemoteCommonArea struct {
	// contains filtered or unexported fields
}

MockRemoteCommonArea is a mock of RemoteCommonArea interface.

func NewMockRemoteCommonArea

func NewMockRemoteCommonArea(ctrl *gomock.Controller) *MockRemoteCommonArea

NewMockRemoteCommonArea creates a new mock instance.

func (*MockRemoteCommonArea) Create

Create mocks base method.

func (*MockRemoteCommonArea) Delete

Delete mocks base method.

func (*MockRemoteCommonArea) DeleteAllOf

func (m *MockRemoteCommonArea) DeleteAllOf(ctx context.Context, obj client.Object, opts ...client.DeleteAllOfOption) error

DeleteAllOf mocks base method.

func (*MockRemoteCommonArea) EXPECT

EXPECT returns an object that allows the caller to indicate expected use.

func (*MockRemoteCommonArea) Get

Get mocks base method.

func (*MockRemoteCommonArea) GetClusterID

func (m *MockRemoteCommonArea) GetClusterID() common.ClusterID

GetClusterID mocks base method.

func (*MockRemoteCommonArea) GetNamespace

func (m *MockRemoteCommonArea) GetNamespace() string

GetNamespace mocks base method.

func (*MockRemoteCommonArea) GetStatus

GetStatus mocks base method.

func (*MockRemoteCommonArea) IsConnected

func (m *MockRemoteCommonArea) IsConnected() bool

IsConnected mocks base method.

func (*MockRemoteCommonArea) List

List mocks base method.

func (*MockRemoteCommonArea) Patch

func (m *MockRemoteCommonArea) Patch(ctx context.Context, obj client.Object, patch client.Patch, opts ...client.PatchOption) error

Patch mocks base method.

func (*MockRemoteCommonArea) RESTMapper

func (m *MockRemoteCommonArea) RESTMapper() meta.RESTMapper

RESTMapper mocks base method.

func (*MockRemoteCommonArea) Scheme

func (m *MockRemoteCommonArea) Scheme() *runtime.Scheme

Scheme mocks base method.

func (*MockRemoteCommonArea) Start

Start mocks base method.

func (*MockRemoteCommonArea) StartWatching

func (m *MockRemoteCommonArea) StartWatching() error

StartWatching mocks base method.

func (*MockRemoteCommonArea) Status

Status mocks base method.

func (*MockRemoteCommonArea) Stop

func (m *MockRemoteCommonArea) Stop() error

Stop mocks base method.

func (*MockRemoteCommonArea) StopWatching

func (m *MockRemoteCommonArea) StopWatching()

StopWatching mocks base method.

func (*MockRemoteCommonArea) Update

Update mocks base method.

type MockRemoteCommonAreaManager

type MockRemoteCommonAreaManager struct {
	// contains filtered or unexported fields
}

MockRemoteCommonAreaManager is a mock of RemoteCommonAreaManager interface.

func NewMockRemoteCommonAreaManager

func NewMockRemoteCommonAreaManager(ctrl *gomock.Controller) *MockRemoteCommonAreaManager

NewMockRemoteCommonAreaManager creates a new mock instance.

func (*MockRemoteCommonAreaManager) AddRemoteCommonArea

func (m *MockRemoteCommonAreaManager) AddRemoteCommonArea(remoteCommonArea RemoteCommonArea)

AddRemoteCommonArea mocks base method.

func (*MockRemoteCommonAreaManager) EXPECT

EXPECT returns an object that allows the caller to indicate expected use.

func (*MockRemoteCommonAreaManager) GetElectedLeaderClusterID

func (m *MockRemoteCommonAreaManager) GetElectedLeaderClusterID() common.ClusterID

GetElectedLeaderClusterID mocks base method.

func (*MockRemoteCommonAreaManager) GetLocalClusterID

func (m *MockRemoteCommonAreaManager) GetLocalClusterID() common.ClusterID

GetLocalClusterID mocks base method.

func (*MockRemoteCommonAreaManager) GetMemberClusterStatues

func (m *MockRemoteCommonAreaManager) GetMemberClusterStatues() []v1alpha1.ClusterStatus

GetMemberClusterStatues mocks base method.

func (*MockRemoteCommonAreaManager) GetRemoteCommonAreas

func (m *MockRemoteCommonAreaManager) GetRemoteCommonAreas() map[common.ClusterID]RemoteCommonArea

GetRemoteCommonAreas mocks base method.

func (*MockRemoteCommonAreaManager) RemoveRemoteCommonArea

func (m *MockRemoteCommonAreaManager) RemoveRemoteCommonArea(remoteCluster RemoteCommonArea)

RemoveRemoteCommonArea mocks base method.

func (*MockRemoteCommonAreaManager) Start

Start mocks base method.

func (*MockRemoteCommonAreaManager) Stop

Stop mocks base method.

type MockRemoteCommonAreaManagerMockRecorder

type MockRemoteCommonAreaManagerMockRecorder struct {
	// contains filtered or unexported fields
}

MockRemoteCommonAreaManagerMockRecorder is the mock recorder for MockRemoteCommonAreaManager.

func (*MockRemoteCommonAreaManagerMockRecorder) AddRemoteCommonArea

func (mr *MockRemoteCommonAreaManagerMockRecorder) AddRemoteCommonArea(remoteCommonArea interface{}) *gomock.Call

AddRemoteCommonArea indicates an expected call of AddRemoteCommonArea.

func (*MockRemoteCommonAreaManagerMockRecorder) GetElectedLeaderClusterID

func (mr *MockRemoteCommonAreaManagerMockRecorder) GetElectedLeaderClusterID() *gomock.Call

GetElectedLeaderClusterID indicates an expected call of GetElectedLeaderClusterID.

func (*MockRemoteCommonAreaManagerMockRecorder) GetLocalClusterID

func (mr *MockRemoteCommonAreaManagerMockRecorder) GetLocalClusterID() *gomock.Call

GetLocalClusterID indicates an expected call of GetLocalClusterID.

func (*MockRemoteCommonAreaManagerMockRecorder) GetMemberClusterStatues

func (mr *MockRemoteCommonAreaManagerMockRecorder) GetMemberClusterStatues() *gomock.Call

GetMemberClusterStatues indicates an expected call of GetMemberClusterStatues.

func (*MockRemoteCommonAreaManagerMockRecorder) GetRemoteCommonAreas

func (mr *MockRemoteCommonAreaManagerMockRecorder) GetRemoteCommonAreas() *gomock.Call

GetRemoteCommonAreas indicates an expected call of GetRemoteCommonAreas.

func (*MockRemoteCommonAreaManagerMockRecorder) RemoveRemoteCommonArea

func (mr *MockRemoteCommonAreaManagerMockRecorder) RemoveRemoteCommonArea(remoteCluster interface{}) *gomock.Call

RemoveRemoteCommonArea indicates an expected call of RemoveRemoteCommonArea.

func (*MockRemoteCommonAreaManagerMockRecorder) Start

Start indicates an expected call of Start.

func (*MockRemoteCommonAreaManagerMockRecorder) Stop

Stop indicates an expected call of Stop.

type MockRemoteCommonAreaMockRecorder

type MockRemoteCommonAreaMockRecorder struct {
	// contains filtered or unexported fields
}

MockRemoteCommonAreaMockRecorder is the mock recorder for MockRemoteCommonArea.

func (*MockRemoteCommonAreaMockRecorder) Create

func (mr *MockRemoteCommonAreaMockRecorder) Create(ctx, obj interface{}, opts ...interface{}) *gomock.Call

Create indicates an expected call of Create.

func (*MockRemoteCommonAreaMockRecorder) Delete

func (mr *MockRemoteCommonAreaMockRecorder) Delete(ctx, obj interface{}, opts ...interface{}) *gomock.Call

Delete indicates an expected call of Delete.

func (*MockRemoteCommonAreaMockRecorder) DeleteAllOf

func (mr *MockRemoteCommonAreaMockRecorder) DeleteAllOf(ctx, obj interface{}, opts ...interface{}) *gomock.Call

DeleteAllOf indicates an expected call of DeleteAllOf.

func (*MockRemoteCommonAreaMockRecorder) Get

func (mr *MockRemoteCommonAreaMockRecorder) Get(ctx, key, obj interface{}) *gomock.Call

Get indicates an expected call of Get.

func (*MockRemoteCommonAreaMockRecorder) GetClusterID

func (mr *MockRemoteCommonAreaMockRecorder) GetClusterID() *gomock.Call

GetClusterID indicates an expected call of GetClusterID.

func (*MockRemoteCommonAreaMockRecorder) GetNamespace

func (mr *MockRemoteCommonAreaMockRecorder) GetNamespace() *gomock.Call

GetNamespace indicates an expected call of GetNamespace.

func (*MockRemoteCommonAreaMockRecorder) GetStatus

func (mr *MockRemoteCommonAreaMockRecorder) GetStatus() *gomock.Call

GetStatus indicates an expected call of GetStatus.

func (*MockRemoteCommonAreaMockRecorder) IsConnected

func (mr *MockRemoteCommonAreaMockRecorder) IsConnected() *gomock.Call

IsConnected indicates an expected call of IsConnected.

func (*MockRemoteCommonAreaMockRecorder) List

func (mr *MockRemoteCommonAreaMockRecorder) List(ctx, list interface{}, opts ...interface{}) *gomock.Call

List indicates an expected call of List.

func (*MockRemoteCommonAreaMockRecorder) Patch

func (mr *MockRemoteCommonAreaMockRecorder) Patch(ctx, obj, patch interface{}, opts ...interface{}) *gomock.Call

Patch indicates an expected call of Patch.

func (*MockRemoteCommonAreaMockRecorder) RESTMapper

func (mr *MockRemoteCommonAreaMockRecorder) RESTMapper() *gomock.Call

RESTMapper indicates an expected call of RESTMapper.

func (*MockRemoteCommonAreaMockRecorder) Scheme

Scheme indicates an expected call of Scheme.

func (*MockRemoteCommonAreaMockRecorder) Start

Start indicates an expected call of Start.

func (*MockRemoteCommonAreaMockRecorder) StartWatching

func (mr *MockRemoteCommonAreaMockRecorder) StartWatching() *gomock.Call

StartWatching indicates an expected call of StartWatching.

func (*MockRemoteCommonAreaMockRecorder) Status

Status indicates an expected call of Status.

func (*MockRemoteCommonAreaMockRecorder) Stop

Stop indicates an expected call of Stop.

func (*MockRemoteCommonAreaMockRecorder) StopWatching

func (mr *MockRemoteCommonAreaMockRecorder) StopWatching() *gomock.Call

StopWatching indicates an expected call of StopWatching.

func (*MockRemoteCommonAreaMockRecorder) Update

func (mr *MockRemoteCommonAreaMockRecorder) Update(ctx, obj interface{}, opts ...interface{}) *gomock.Call

Update indicates an expected call of Update.

type RemoteCommonArea

type RemoteCommonArea interface {
	CommonArea

	Start() (context.CancelFunc, error)

	Stop() error

	// IsConnected returns whether the RemoteCommonArea is accessible or not.
	IsConnected() bool

	// StartWatching sets up a Manager to reconcile resource crud operations from CommonArea of RemoteCommonArea.
	StartWatching() error

	// StopWatching stops the Manager so the crud operations in RemoteCommonArea no longer invoke the reconcilers.
	StopWatching()

	GetStatus() []multiclusterv1alpha1.ClusterCondition
}

RemoteCommonArea is an abstraction to connect to CommonArea of the Leader Cluster.

func NewFakeRemoteCommonArea

func NewFakeRemoteCommonArea(scheme *runtime.Scheme,
	remoteCommonAreaManager *RemoteCommonAreaManager,
	fakeClient client.Client, clusterID string, namespace string) RemoteCommonArea

NewFakeRemoteCommonArea creates a new fakeRemoteCommonArea for unit test purpose only

type RemoteCommonAreaManager

type RemoteCommonAreaManager interface {
	// Start starts RemoteCommonAreaManager on an event loop which runs in a goroutine
	Start() error
	// Stop stop RemoteCommonAreaManager by terminating the event loop.
	Stop() error
	// AddRemoteCommonArea adds a RemoteCommonArea to RemoteCommonAreaManager.
	AddRemoteCommonArea(remoteCommonArea RemoteCommonArea)
	// RemoveRemoteCommonArea removes a RemoteCommonArea from RemoteCommonAreaManager.
	RemoveRemoteCommonArea(remoteCluster RemoteCommonArea)
	// GetRemoteCommonAreas returns all RemoteCommonArea
	GetRemoteCommonAreas() map[common.ClusterID]RemoteCommonArea
	// GetElectedLeaderClusterID returns the elected, leader RemoteCommonArea or InvalidClusterID if none elected
	GetElectedLeaderClusterID() common.ClusterID
	// GetLocalClusterID returns local cluster ID
	GetLocalClusterID() common.ClusterID
	GetMemberClusterStatues() []multiclusterv1alpha1.ClusterStatus
}

func NewRemoteCommonAreaManager

func NewRemoteCommonAreaManager(clusterSetID common.ClusterSetID, clusterID common.ClusterID) RemoteCommonAreaManager

type ResourceImportReconciler

type ResourceImportReconciler struct {
	client.Client
	Scheme *runtime.Scheme
	// contains filtered or unexported fields
}

ResourceImportReconciler reconciles a ResourceImport object in the member cluster.

func NewResourceImportReconciler

func NewResourceImportReconciler(client client.Client, scheme *runtime.Scheme, localClusterClient client.Client, remoteCommonArea RemoteCommonArea) *ResourceImportReconciler

func (*ResourceImportReconciler) Reconcile

Reconcile will attempt to ensure that the imported Resource is installed in local cluster as per the ResourceImport object.

func (*ResourceImportReconciler) SetupWithManager

func (r *ResourceImportReconciler) SetupWithManager(mgr ctrl.Manager) error

SetupWithManager sets up the controller with the ClusterManager which will set up controllers for resources that need to be monitored in the remoteCommonArea.

Jump to

Keyboard shortcuts

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