Documentation ¶
Index ¶
- func NewRemoteClusterSecretHandler(opts SecretHandlerOpts) handler.Handler
- type Resolver
- type SecretHandler
- func (s *SecretHandler) Added(ctx context.Context, obj interface{}, ...) controller.EventStatus
- func (s *SecretHandler) Deleted(ctx context.Context, obj interface{}, ...) controller.EventStatus
- func (s *SecretHandler) OnStatus(_ context.Context, _ controller.EventProcessStatus)
- func (s *SecretHandler) Updated(ctx context.Context, newObj interface{}, oldObj interface{}, ...) controller.EventStatus
- type SecretHandlerOpts
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 (s *SecretHandler) OnStatus(_ context.Context, _ controller.EventProcessStatus)
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
}
Click to show internal directories.
Click to hide internal directories.