Documentation ¶
Index ¶
- Constants
- func GetClusterName(obj metav1.Object) string
- func GetClusterNameNs(ns string) (clusterName, namespace string)
- func GetOwnerClusterName(sub metav1.Object) string
- func GetOwnerNameNs(sub metav1.Object) types.NamespacedName
- func MuiltClustersEnqueue(clusterName string) handler.EventHandler
- func SetClusterName(obj metav1.Object, cluster string)
- func SetOwner(owner, sub metav1.Object)
- type MulitClusterClient
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 GetClusterNameNs ¶
GetClusterNameNs 获取集群名称和 NS
func GetOwnerClusterName ¶
GetOwnerClusterName 获取当前资源 owner 所在集群
func MuiltClustersEnqueue ¶
func MuiltClustersEnqueue(clusterName string) handler.EventHandler
MuiltClustersEnqueue 多集群入队器 将集群名称附加在 Namespace 上
func SetClusterName ¶
SetClusterName 设置资源当前的集群名称
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 ...
Click to show internal directories.
Click to hide internal directories.