Documentation ¶
Index ¶
Constants ¶
View Source
const ( // Clusters Clients Pool context key ClustersClientsPoolCtxKey key = iota )
Variables ¶
This section is empty.
Functions ¶
func WithClustersClients ¶
func WithClustersClients(clustersFetcher ClusterFetcher, next http.Handler) http.Handler
WithClustersClients creates clusters client for provided user in the context
Types ¶
type ClientsPool ¶
type ClientsPool interface { Add(user *auth.UserPrincipal, cluster Cluster) error Clients() map[string]client.Client }
ClientsPool stores all clients to the leaf clusters
func ClientsPoolFromCtx ¶
func ClientsPoolFromCtx(ctx context.Context) ClientsPool
ClientsPoolFromCtx returns the ClusterClients pool stored in the context
func NewClustersClientsPool ¶
func NewClustersClientsPool() ClientsPool
NewClustersClientsPool initializes a new ClientsPool
type Cluster ¶
type Cluster struct { // Name defines the cluster name Name string `yaml:"name"` // Server defines cluster api address Server string `yaml:"server"` // SecretRef defines secret name that holds the cluster Bearer Token SecretRef string `yaml:"secretRef"` // BearerToken cluster access token read from SecretRef BearerToken string // TLSConfig holds configuration for TLS connection with the cluster values read from SecretRef TLSConfig rest.TLSClientConfig }
Cluster defines a leaf cluster
type ClusterFetcher ¶
ClusterFetcher fetches all leaf clusters
func NewSingleClusterFetcher ¶
func NewSingleClusterFetcher(config *rest.Config) (ClusterFetcher, error)
Click to show internal directories.
Click to hide internal directories.