Documentation ¶
Overview ¶
package commonarea is a generated GoMock package.
package commonarea is a generated GoMock package.
Index ¶
- Constants
- Variables
- type CommonArea
- type LeaderElector
- type MockRemoteCommonArea
- func (m *MockRemoteCommonArea) Create(ctx context.Context, obj client.Object, opts ...client.CreateOption) error
- func (m *MockRemoteCommonArea) Delete(ctx context.Context, obj client.Object, opts ...client.DeleteOption) error
- func (m *MockRemoteCommonArea) DeleteAllOf(ctx context.Context, obj client.Object, opts ...client.DeleteAllOfOption) error
- func (m *MockRemoteCommonArea) EXPECT() *MockRemoteCommonAreaMockRecorder
- func (m *MockRemoteCommonArea) Get(ctx context.Context, key client.ObjectKey, obj client.Object) error
- func (m *MockRemoteCommonArea) GetClusterID() common.ClusterID
- func (m *MockRemoteCommonArea) GetNamespace() string
- func (m *MockRemoteCommonArea) GetStatus() []v1alpha1.ClusterCondition
- func (m *MockRemoteCommonArea) IsConnected() bool
- func (m *MockRemoteCommonArea) List(ctx context.Context, list client.ObjectList, opts ...client.ListOption) error
- func (m *MockRemoteCommonArea) Patch(ctx context.Context, obj client.Object, patch client.Patch, ...) error
- func (m *MockRemoteCommonArea) RESTMapper() meta.RESTMapper
- func (m *MockRemoteCommonArea) Scheme() *runtime.Scheme
- func (m *MockRemoteCommonArea) Start() (context.CancelFunc, error)
- func (m *MockRemoteCommonArea) StartWatching() error
- func (m *MockRemoteCommonArea) Status() client.StatusWriter
- func (m *MockRemoteCommonArea) Stop() error
- func (m *MockRemoteCommonArea) StopWatching()
- func (m *MockRemoteCommonArea) Update(ctx context.Context, obj client.Object, opts ...client.UpdateOption) error
- type MockRemoteCommonAreaManager
- func (m *MockRemoteCommonAreaManager) AddRemoteCommonArea(remoteCommonArea RemoteCommonArea)
- func (m *MockRemoteCommonAreaManager) EXPECT() *MockRemoteCommonAreaManagerMockRecorder
- func (m *MockRemoteCommonAreaManager) GetElectedLeaderClusterID() common.ClusterID
- func (m *MockRemoteCommonAreaManager) GetLocalClusterID() common.ClusterID
- func (m *MockRemoteCommonAreaManager) GetMemberClusterStatues() []v1alpha1.ClusterStatus
- func (m *MockRemoteCommonAreaManager) GetRemoteCommonAreas() map[common.ClusterID]RemoteCommonArea
- func (m *MockRemoteCommonAreaManager) RemoveRemoteCommonArea(remoteCluster RemoteCommonArea)
- func (m *MockRemoteCommonAreaManager) Start() error
- func (m *MockRemoteCommonAreaManager) Stop() error
- type MockRemoteCommonAreaManagerMockRecorder
- func (mr *MockRemoteCommonAreaManagerMockRecorder) AddRemoteCommonArea(remoteCommonArea interface{}) *gomock.Call
- func (mr *MockRemoteCommonAreaManagerMockRecorder) GetElectedLeaderClusterID() *gomock.Call
- func (mr *MockRemoteCommonAreaManagerMockRecorder) GetLocalClusterID() *gomock.Call
- func (mr *MockRemoteCommonAreaManagerMockRecorder) GetMemberClusterStatues() *gomock.Call
- func (mr *MockRemoteCommonAreaManagerMockRecorder) GetRemoteCommonAreas() *gomock.Call
- func (mr *MockRemoteCommonAreaManagerMockRecorder) RemoveRemoteCommonArea(remoteCluster interface{}) *gomock.Call
- func (mr *MockRemoteCommonAreaManagerMockRecorder) Start() *gomock.Call
- func (mr *MockRemoteCommonAreaManagerMockRecorder) Stop() *gomock.Call
- type MockRemoteCommonAreaMockRecorder
- func (mr *MockRemoteCommonAreaMockRecorder) Create(ctx, obj interface{}, opts ...interface{}) *gomock.Call
- func (mr *MockRemoteCommonAreaMockRecorder) Delete(ctx, obj interface{}, opts ...interface{}) *gomock.Call
- func (mr *MockRemoteCommonAreaMockRecorder) DeleteAllOf(ctx, obj interface{}, opts ...interface{}) *gomock.Call
- func (mr *MockRemoteCommonAreaMockRecorder) Get(ctx, key, obj interface{}) *gomock.Call
- func (mr *MockRemoteCommonAreaMockRecorder) GetClusterID() *gomock.Call
- func (mr *MockRemoteCommonAreaMockRecorder) GetNamespace() *gomock.Call
- func (mr *MockRemoteCommonAreaMockRecorder) GetStatus() *gomock.Call
- func (mr *MockRemoteCommonAreaMockRecorder) IsConnected() *gomock.Call
- func (mr *MockRemoteCommonAreaMockRecorder) List(ctx, list interface{}, opts ...interface{}) *gomock.Call
- func (mr *MockRemoteCommonAreaMockRecorder) Patch(ctx, obj, patch interface{}, opts ...interface{}) *gomock.Call
- func (mr *MockRemoteCommonAreaMockRecorder) RESTMapper() *gomock.Call
- func (mr *MockRemoteCommonAreaMockRecorder) Scheme() *gomock.Call
- func (mr *MockRemoteCommonAreaMockRecorder) Start() *gomock.Call
- func (mr *MockRemoteCommonAreaMockRecorder) StartWatching() *gomock.Call
- func (mr *MockRemoteCommonAreaMockRecorder) Status() *gomock.Call
- func (mr *MockRemoteCommonAreaMockRecorder) Stop() *gomock.Call
- func (mr *MockRemoteCommonAreaMockRecorder) StopWatching() *gomock.Call
- func (mr *MockRemoteCommonAreaMockRecorder) Update(ctx, obj interface{}, opts ...interface{}) *gomock.Call
- type RemoteCommonArea
- type RemoteCommonAreaManager
- type ResourceImportReconciler
Constants ¶
const (
TimestampAnnotationKey = "touch-ts"
)
Variables ¶
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 ¶
func (m *MockRemoteCommonArea) Create(ctx context.Context, obj client.Object, opts ...client.CreateOption) error
Create mocks base method.
func (*MockRemoteCommonArea) Delete ¶
func (m *MockRemoteCommonArea) Delete(ctx context.Context, obj client.Object, opts ...client.DeleteOption) error
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 ¶
func (m *MockRemoteCommonArea) EXPECT() *MockRemoteCommonAreaMockRecorder
EXPECT returns an object that allows the caller to indicate expected use.
func (*MockRemoteCommonArea) Get ¶
func (m *MockRemoteCommonArea) Get(ctx context.Context, key client.ObjectKey, obj client.Object) error
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 ¶
func (m *MockRemoteCommonArea) GetStatus() []v1alpha1.ClusterCondition
GetStatus mocks base method.
func (*MockRemoteCommonArea) IsConnected ¶
func (m *MockRemoteCommonArea) IsConnected() bool
IsConnected mocks base method.
func (*MockRemoteCommonArea) List ¶
func (m *MockRemoteCommonArea) List(ctx context.Context, list client.ObjectList, opts ...client.ListOption) error
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 ¶
func (m *MockRemoteCommonArea) Start() (context.CancelFunc, error)
Start mocks base method.
func (*MockRemoteCommonArea) StartWatching ¶
func (m *MockRemoteCommonArea) StartWatching() error
StartWatching mocks base method.
func (*MockRemoteCommonArea) Status ¶
func (m *MockRemoteCommonArea) Status() client.StatusWriter
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 ¶
func (m *MockRemoteCommonArea) Update(ctx context.Context, obj client.Object, opts ...client.UpdateOption) error
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 ¶
func (m *MockRemoteCommonAreaManager) EXPECT() *MockRemoteCommonAreaManagerMockRecorder
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 ¶
func (m *MockRemoteCommonAreaManager) Start() error
Start mocks base method.
func (*MockRemoteCommonAreaManager) Stop ¶
func (m *MockRemoteCommonAreaManager) Stop() error
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 ¶
func (mr *MockRemoteCommonAreaManagerMockRecorder) Start() *gomock.Call
Start indicates an expected call of Start.
func (*MockRemoteCommonAreaManagerMockRecorder) Stop ¶
func (mr *MockRemoteCommonAreaManagerMockRecorder) Stop() *gomock.Call
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 ¶
func (mr *MockRemoteCommonAreaMockRecorder) Scheme() *gomock.Call
Scheme indicates an expected call of Scheme.
func (*MockRemoteCommonAreaMockRecorder) Start ¶
func (mr *MockRemoteCommonAreaMockRecorder) Start() *gomock.Call
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 ¶
func (mr *MockRemoteCommonAreaMockRecorder) Status() *gomock.Call
Status indicates an expected call of Status.
func (*MockRemoteCommonAreaMockRecorder) Stop ¶
func (mr *MockRemoteCommonAreaMockRecorder) Stop() *gomock.Call
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 ¶
func (r *ResourceImportReconciler) Reconcile(ctx context.Context, req ctrl.Request) (ctrl.Result, error)
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.