controllers

package
v0.0.0-...-c602d75 Latest Latest
Warning

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

Go to latest
Published: Nov 22, 2022 License: MIT Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetClusterNameNs

func GetClusterNameNs(ns string) (clusterName, namespace string)

GetClusterNameNs 获取集群名称和 NS

func MuiltClustersEnqueue

func MuiltClustersEnqueue(clusterName string) handler.EventHandler

MuiltClustersEnqueue 多集群入队器 将集群名称附加在 Namespace 上

Types

type TestJobReconciler

type TestJobReconciler struct {
	// 主集群 client
	client.Client

	// 所有集群的客户端列表
	Clients map[string]client.Client

	Scheme *runtime.Scheme
}

TestJobReconciler reconciles a Test object

func NewTestJobReconciler

func NewTestJobReconciler(mgr ctrl.Manager, clusters map[string]cluster.Cluster) (*TestJobReconciler, error)

NewTestReconciler ...

func (*TestJobReconciler) GetClient

func (r *TestJobReconciler) GetClient(name string) client.Client

GetClient by cluster name

func (*TestJobReconciler) GetClientByNs

func (r *TestJobReconciler) GetClientByNs(ns string) client.Client

GetClientByNs 通过命名空间获取 client

func (*TestJobReconciler) Reconcile

func (r *TestJobReconciler) Reconcile(ctx context.Context, req ctrl.Request) (ctrl.Result, error)

func (*TestJobReconciler) SetupWithManager

func (r *TestJobReconciler) SetupWithManager(mgr ctrl.Manager, cs map[string]cluster.Cluster) error

SetupWithManager sets up the controller with the Manager.

type TestReconciler

type TestReconciler struct {
	// 主集群 client
	client.Client

	// 所有集群的客户端列表
	Clients map[string]client.Client

	Scheme *runtime.Scheme
}

TestReconciler reconciles a Test object

func NewTestReconciler

func NewTestReconciler(mgr ctrl.Manager, clusters map[string]cluster.Cluster) (*TestReconciler, error)

NewTestReconciler ...

func (*TestReconciler) Reconcile

func (r *TestReconciler) 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. For more details, check Reconcile and its Result here: - https://pkg.go.dev/sigs.k8s.io/controller-runtime@v0.11.2/pkg/reconcile

func (*TestReconciler) SetupWithManager

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

SetupWithManager sets up the controller with the Manager.

Jump to

Keyboard shortcuts

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