clusterx

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: 6 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// ClusterSeparator 集群分割
	ClusterSeparator = "/"
	// DefaultClusterName 默认集群名字
	DefaultClusterName = "default"
)
View Source
const (
	OwnerNameKey      = "owner.name"
	OwnerNamespaceKey = "owner.namespace"
	OwnerClusterKey   = "owner.cluster"
)

owner 资源关联

View Source
const ClusterNameKey = "cluster.name"

创建时给资源添加一个注解

Variables

This section is empty.

Functions

func GetClusterName

func GetClusterName(obj metav1.Object) string

GetClusterName 获取资源当前的集群名称

func GetClusterNameNs

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

GetClusterNameNs 获取集群名称和 NS

func GetOwnerClusterName

func GetOwnerClusterName(sub metav1.Object) string

GetOwnerClusterName 获取当前资源 owner 所在集群

func GetOwnerNameNs

func GetOwnerNameNs(sub metav1.Object) types.NamespacedName

GetOwnerNameNs 获取

func MuiltClustersEnqueue

func MuiltClustersEnqueue(clusterName string) handler.EventHandler

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

func SetClusterName

func SetClusterName(obj metav1.Object, cluster string)

SetClusterName 设置资源当前的集群名称

func SetOwner

func SetOwner(owner, sub metav1.Object)

SetOwner 注入 owner 相关标签

Types

type MulitClusterClient

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

MulitClusterClient 多集群 client

func (MulitClusterClient) GetClient

func (mc MulitClusterClient) GetClient(name string) client.Client

GetClient by cluster name

func (MulitClusterClient) GetClientByNs

func (mc MulitClusterClient) GetClientByNs(ns string) client.Client

GetClientByNs 通过命名空间获取 client

func (MulitClusterClient) GetClientByObj

func (mc MulitClusterClient) GetClientByObj(obj client.Object) client.Client

GetClientByObj ...

func (MulitClusterClient) GetOwnerClient

func (mc MulitClusterClient) GetOwnerClient(obj client.Object) client.Client

GetOwnerClient ...

Jump to

Keyboard shortcuts

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