remotecluster

package
v0.0.0-...-59d7cbf Latest Latest
Warning

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

Go to latest
Published: Mar 21, 2024 License: Apache-2.0 Imports: 19 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewRemoteClusterSecretHandler

func NewRemoteClusterSecretHandler(opts SecretHandlerOpts) handler.Handler

NewRemoteClusterSecretHandler creates a new handler for remote cluster secrets The handler is responsible to listen for remote cluster secrets When a new secret is added/updated, the handler resolves the secret to get the remote cluster config and creates a new remote cluster in cache The handler also starts the relevant controllers (deployment, rollout, service) for the remote cluster.

Types

type Resolver

type Resolver interface {
	GetConfigLoader() k8s_utils.ClientConfigLoader
	ResolveConfig(ctx context.Context, secretKey, secretIdentifier string, secretValue []byte) (remotecluster.RemoteCluster, error)
	StartRemoteClusterControllers(ctx context.Context, cluster remotecluster.RemoteCluster)
	StopRemoteClusterControllers(ctx context.Context, clusterID string)
	AddRemoteClusterToCache(ctx context.Context, remoteCluster remotecluster.RemoteCluster)
	DeleteRemoteClusterFromCache(ctx context.Context, clusterID string)
	GetRemoteClusterFromCache(ctx context.Context, clusterID string) (remotecluster.RemoteCluster, bool)
}

func NewRemoteClusterResolver

func NewRemoteClusterResolver(configResolver resolver.ConfigResolver, clientConfigLoader k8s_utils.ClientConfigLoader) Resolver

NewRemoteClusterResolver is resolves the secret into a k8s config and client It also implements methods to interact with the remote cluster cache.

type SecretHandler

type SecretHandler struct {
	RemoteClusterResolver Resolver
}

func (*SecretHandler) Added

func (s *SecretHandler) Added(ctx context.Context, obj interface{}, statusChan chan controller.EventProcessStatus) controller.EventStatus

func (*SecretHandler) Deleted

func (s *SecretHandler) Deleted(ctx context.Context, obj interface{}, statusChan chan controller.EventProcessStatus) controller.EventStatus

func (*SecretHandler) OnStatus

func (*SecretHandler) Updated

func (s *SecretHandler) Updated(ctx context.Context, newObj interface{}, oldObj interface{}, statusChan chan controller.EventProcessStatus) controller.EventStatus

type SecretHandlerOpts

type SecretHandlerOpts struct {
	RemoteClusterResolver Resolver
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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