Documentation ¶
Index ¶
- type ClientFactory
- type ConfigFactory
- type ConfigSecretGetter
- type ConfigSecretStore
- type DefaultConfigFactory
- type DynamicClientFactory
- type DynamicFileClientFactory
- type Logger
- type MockDynamicFileClient
- type Service
- func (s *Service) DeleteObject(ctx context.Context, clusterID uint, o client.Object) error
- func (s *Service) EnsureObject(ctx context.Context, clusterID uint, o client.Object) error
- func (s *Service) GetKubeConfig(ctx context.Context, clusterID uint) (*rest.Config, error)
- func (s *Service) GetObject(ctx context.Context, clusterID uint, objRef corev1.ObjectReference, ...) error
- func (s *Service) List(ctx context.Context, clusterID uint, labels map[string]string, ...) error
- func (s *Service) Update(ctx context.Context, clusterID uint, o client.Object) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ClientFactory ¶
type ClientFactory struct {
// contains filtered or unexported fields
}
ClientFactory returns a Kubernetes client.
func NewClientFactory ¶
func NewClientFactory(configFactory ConfigFactory) ClientFactory
NewClientFactory returns a new ClientFactory.
func (ClientFactory) FromSecret ¶
func (f ClientFactory) FromSecret(ctx context.Context, secretID string) (kubernetes.Interface, error)
FromSecret creates a Kubernetes client for a cluster from a secret.
type ConfigFactory ¶
type ConfigFactory interface { // FromSecret returns a config from a secret. FromSecret(ctx context.Context, secretID string) (*rest.Config, error) }
ConfigFactory returns a Kubernetes configuration.
type ConfigSecretGetter ¶
type ConfigSecretGetter interface { // GetConfigSecretID returns a config secret ID for a cluster. GetConfigSecretID(ctx context.Context, clusterID uint) (string, error) }
ConfigSecretGetter returns a config secret ID for a cluster.
type ConfigSecretStore ¶
type ConfigSecretStore interface { // GetSecretValues returns the values stored within a secret. // If the underlying store uses additional keys for determining the exact secret path // (eg. organization ID), it should be retrieved from the context. GetSecretValues(ctx context.Context, secretID string) (map[string]string, error) }
type DefaultConfigFactory ¶
type DefaultConfigFactory struct {
// contains filtered or unexported fields
}
DefaultConfigFactory is a default implementation of the ConfigFactory interface.
func NewConfigFactory ¶
func NewConfigFactory(secrets ConfigSecretStore) DefaultConfigFactory
NewConfigFactory returns a new ConfigFactory.
func (DefaultConfigFactory) FromSecret ¶
func (f DefaultConfigFactory) FromSecret(ctx context.Context, secretID string) (*rest.Config, error)
FromSecret returns a config from a secret.
type DynamicClientFactory ¶
type DynamicClientFactory struct {
// contains filtered or unexported fields
}
DynamicClientFactory returns a dynamic Kubernetes client.
func NewDynamicClientFactory ¶
func NewDynamicClientFactory(configFactory ConfigFactory) DynamicClientFactory
NewDynamicClientFactory returns a new DynamicClientFactory.
func (DynamicClientFactory) FromSecret ¶
func (f DynamicClientFactory) FromSecret(ctx context.Context, secretID string) (dynamic.Interface, error)
FromSecret creates a Kubernetes client for a cluster from a secret.
type DynamicFileClientFactory ¶
type DynamicFileClientFactory struct {
// contains filtered or unexported fields
}
DynamicFileClientFactory returns a DynamicFileClient.
func NewDynamicFileClientFactory ¶
func NewDynamicFileClientFactory(configFactory ConfigFactory) DynamicFileClientFactory
NewDynamicFileClientFactory returns a new DynamicFileClientFactory.
func (DynamicFileClientFactory) FromSecret ¶
func (f DynamicFileClientFactory) FromSecret(ctx context.Context, secretID string) (k8s.DynamicFileClient, error)
FromSecret creates a DynamicFileClient for a cluster from a secret.
type MockDynamicFileClient ¶
MockDynamicFileClient is an autogenerated mock type for the DynamicFileClient type
type Service ¶
type Service struct {
// contains filtered or unexported fields
}
Service provides an interface for using client-go on a specific cluster.
func NewService ¶
func NewService( configSecretGetter ConfigSecretGetter, configFactory ConfigFactory, logger Logger, ) *Service
NewService returns a new NewService.
func (*Service) DeleteObject ¶
DeleteObject deletes an Object from a specific cluster.
func (*Service) EnsureObject ¶
EnsureObject makes sure that a given Object is on the cluster and returns it.
func (*Service) GetKubeConfig ¶
GetKubeConfig gets a kube config for a specific cluster.
func (*Service) GetObject ¶
func (s *Service) GetObject(ctx context.Context, clusterID uint, objRef corev1.ObjectReference, obj client.Object) error
GetObject gets an Object from a specific cluster.