Documentation ¶
Overview ¶
memberclusterannounce_controller is for leader cluster only.
Package leader is a generated GoMock package.
Index ¶
- Variables
- func GetResourceImportName(resExport *mcsv1alpha1.ResourceExport) types.NamespacedName
- func RemoveDeletedResourceExports(items []mcsv1alpha1.ResourceExport) []mcsv1alpha1.ResourceExport
- func SvcPortsConverter(svcPort []corev1.ServicePort) []mcs.ServicePort
- type LabelIdentityExportReconciler
- type LeaderClusterSetReconciler
- type MemberClusterAnnounceReconciler
- func (r *MemberClusterAnnounceReconciler) GetMemberClusterStatuses() []multiclusterv1alpha1.ClusterStatus
- func (r *MemberClusterAnnounceReconciler) Reconcile(ctx context.Context, req ctrl.Request) (ctrl.Result, error)
- func (r *MemberClusterAnnounceReconciler) SetupWithManager(mgr ctrl.Manager) error
- type MemberClusterStatusManager
- type MockMemberClusterStatusManager
- type MockMemberClusterStatusManagerMockRecorder
- type ResourceExportReconciler
Constants ¶
This section is empty.
Variables ¶
var ( ReasonConnected = "Connected" ReasonDisconnected = "Disconnected" MemberClusterAnnounceFinalizer = "memberclusterannounce.finalizer.antrea.io" TimerInterval = 10 * time.Second ConnectionTimeout = 3 * TimerInterval )
var (
NoReadyCluster = "NoReadyCluster"
)
Functions ¶
func GetResourceImportName ¶
func GetResourceImportName(resExport *mcsv1alpha1.ResourceExport) types.NamespacedName
func RemoveDeletedResourceExports ¶
func RemoveDeletedResourceExports(items []mcsv1alpha1.ResourceExport) []mcsv1alpha1.ResourceExport
We use finalizers as ResourceExport pre-delete hooks, which means when we list the ResourceExports, it will also return deleted items. RemoveDeletedResourceExports remove any ResourceExports with non-zero DeletionTimestamp which is actually deleted object.
func SvcPortsConverter ¶
func SvcPortsConverter(svcPort []corev1.ServicePort) []mcs.ServicePort
Types ¶
type LabelIdentityExportReconciler ¶
type LabelIdentityExportReconciler struct { client.Client Scheme *runtime.Scheme // contains filtered or unexported fields }
LabelIdentityExportReconciler watches LabelIdentity ResourceExport events in the Common Area, computes if such an event causes a new LabelIdentity to become present/stale in the entire ClusterSet, and updates ResourceImports accordingly.
func (*LabelIdentityExportReconciler) Reconcile ¶
func (r *LabelIdentityExportReconciler) Reconcile(ctx context.Context, req ctrl.Request) (ctrl.Result, error)
+kubebuilder:rbac:groups=multicluster.crd.antrea.io,resources=resourceexports,verbs=get;list;watch;create;update;patch;delete +kubebuilder:rbac:groups=multicluster.crd.antrea.io,resources=resourceexports/status,verbs=get;update;patch
func (*LabelIdentityExportReconciler) Run ¶
func (r *LabelIdentityExportReconciler) Run(stopCh <-chan struct{})
Run begins syncing of ResourceImports for label identities.
func (*LabelIdentityExportReconciler) SetupWithManager ¶
func (r *LabelIdentityExportReconciler) SetupWithManager(mgr ctrl.Manager) error
SetupWithManager sets up the controller with the Manager.
type LeaderClusterSetReconciler ¶
type LeaderClusterSetReconciler struct { client.Client Scheme *runtime.Scheme StatusManager MemberClusterStatusManager // contains filtered or unexported fields }
LeaderClusterSetReconciler reconciles a ClusterSet object in the leader cluster deployment. Each ClusterSet should have one Multi-cluster Controller running in the ClusterSet' leader Namespace, so a MC Controller will be handling only a single ClusterSet in the given Namespace.
func (*LeaderClusterSetReconciler) Reconcile ¶
func (r *LeaderClusterSetReconciler) Reconcile(ctx context.Context, req ctrl.Request) (ctrl.Result, error)
Reconcile ClusterSet changes
func (*LeaderClusterSetReconciler) SetupWithManager ¶
func (r *LeaderClusterSetReconciler) SetupWithManager(mgr ctrl.Manager) error
SetupWithManager sets up the controller with the Manager.
type MemberClusterAnnounceReconciler ¶
type MemberClusterAnnounceReconciler struct { client.Client Scheme *runtime.Scheme // contains filtered or unexported fields }
MemberClusterAnnounceReconciler reconciles a MemberClusterAnnounce object
func NewMemberClusterAnnounceReconciler ¶
func NewMemberClusterAnnounceReconciler(client client.Client, scheme *runtime.Scheme) *MemberClusterAnnounceReconciler
func (*MemberClusterAnnounceReconciler) GetMemberClusterStatuses ¶
func (r *MemberClusterAnnounceReconciler) GetMemberClusterStatuses() []multiclusterv1alpha1.ClusterStatus
func (*MemberClusterAnnounceReconciler) Reconcile ¶
func (r *MemberClusterAnnounceReconciler) Reconcile(ctx context.Context, req ctrl.Request) (ctrl.Result, error)
Reconcile implements cluster status management on the leader cluster
func (*MemberClusterAnnounceReconciler) SetupWithManager ¶
func (r *MemberClusterAnnounceReconciler) SetupWithManager(mgr ctrl.Manager) error
SetupWithManager sets up the controller with the Manager.
type MemberClusterStatusManager ¶
type MemberClusterStatusManager interface {
GetMemberClusterStatuses() []multiclusterv1alpha1.ClusterStatus
}
type MockMemberClusterStatusManager ¶
type MockMemberClusterStatusManager struct {
// contains filtered or unexported fields
}
MockMemberClusterStatusManager is a mock of MemberClusterStatusManager interface
func NewMockMemberClusterStatusManager ¶
func NewMockMemberClusterStatusManager(ctrl *gomock.Controller) *MockMemberClusterStatusManager
NewMockMemberClusterStatusManager creates a new mock instance
func (*MockMemberClusterStatusManager) EXPECT ¶
func (m *MockMemberClusterStatusManager) EXPECT() *MockMemberClusterStatusManagerMockRecorder
EXPECT returns an object that allows the caller to indicate expected use
func (*MockMemberClusterStatusManager) GetMemberClusterStatuses ¶
func (m *MockMemberClusterStatusManager) GetMemberClusterStatuses() []v1alpha1.ClusterStatus
GetMemberClusterStatuses mocks base method
type MockMemberClusterStatusManagerMockRecorder ¶
type MockMemberClusterStatusManagerMockRecorder struct {
// contains filtered or unexported fields
}
MockMemberClusterStatusManagerMockRecorder is the mock recorder for MockMemberClusterStatusManager
func (*MockMemberClusterStatusManagerMockRecorder) GetMemberClusterStatuses ¶
func (mr *MockMemberClusterStatusManagerMockRecorder) GetMemberClusterStatuses() *gomock.Call
GetMemberClusterStatuses indicates an expected call of GetMemberClusterStatuses
type ResourceExportReconciler ¶
ResourceExportReconciler reconciles a ResourceExport object in the leader cluster.
func NewResourceExportReconciler ¶
func NewResourceExportReconciler( client client.Client, scheme *runtime.Scheme) *ResourceExportReconciler
func (*ResourceExportReconciler) Reconcile ¶
func (r *ResourceExportReconciler) Reconcile(ctx context.Context, req ctrl.Request) (ctrl.Result, error)
Reconcile is part of the main kubernetes reconciliation loop which aims to move the current state of the cluster closer to the desired state. Reconcile will process all kinds of ResourceExport. Service and Endpoint kinds of ResourceExport will be handled in this file, and all other kinds will have their own handler files, eg: newkind_handler.go
func (*ResourceExportReconciler) SetupWithManager ¶
func (r *ResourceExportReconciler) SetupWithManager(mgr ctrl.Manager) error
SetupWithManager sets up the controller with the Manager.