clustersmngr

package
v0.7.0-rc4 Latest Latest
Warning

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

Go to latest
Published: Mar 28, 2022 License: MPL-2.0 Imports: 7 Imported by: 14

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

type ClusterFetcher interface {
	Fetch(ctx context.Context) ([]Cluster, error)
}

ClusterFetcher fetches all leaf clusters

func NewSingleClusterFetcher

func NewSingleClusterFetcher(config *rest.Config) (ClusterFetcher, error)

Directories

Path Synopsis
Code generated by counterfeiter.
Code generated by counterfeiter.

Jump to

Keyboard shortcuts

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