Documentation ¶
Overview ¶
This file contains functions common to the controllers to help them interace with elasticsearch.
Index ¶
- Constants
- Variables
- func AddAPIServerWatch(c controller.Controller) error
- func AddComplianceWatch(c controller.Controller) error
- func AddConfigMapWatch(c controller.Controller, name, namespace string) error
- func AddLogStorageWatch(c controller.Controller) error
- func AddNetworkWatch(c controller.Controller) error
- func AddSecretsWatch(c controller.Controller, name, namespace string) error
- func AutoDiscoverProvider(cfg *rest.Config) (operatorv1.Provider, error)
- func CheckLicenseKey(ctx context.Context, cli client.Client) error
- func ClusterName(ctx context.Context, cli client.Client) (string, error)
- func ContextLoggerForResource(log logr.Logger, obj runtime.Object) logr.Logger
- func ElasticsearchSecrets(ctx context.Context, esUsernames []string, cli client.Client) ([]*corev1.Secret, error)
- func GetLogStorage(ctx context.Context, cli client.Client) (*operatorv1.LogStorage, error)
- func GetNetworkingPullSecrets(i *operatorv1.Installation, c client.Client) ([]*corev1.Secret, error)
- func GetReadyLogStorage(ctx context.Context, cli client.Client) (*operatorv1.LogStorage, error)
- func IgnoreObject(obj runtime.Object) bool
- func IsAPIServerReady(client client.Client, l logr.Logger) bool
- func IsLogStorageReady(ctx context.Context, cli client.Client) (bool, error)
- func RandomPassword(length int) (string, error)
- func RequiresTigeraSecure(cfg *rest.Config) (bool, error)
- func ValidateCertPair(client client.Client, certPairSecretName, keyName, certName string) (*corev1.Secret, error)
- type ComponentHandler
Constants ¶
const (
DefaultClusterName = "cluster"
)
Variables ¶
var DefaultInstanceKey = client.ObjectKey{Name: "default"}
var DefaultTSEEInstanceKey = client.ObjectKey{Name: "tigera-secure"}
Functions ¶
func AddAPIServerWatch ¶
func AddAPIServerWatch(c controller.Controller) error
func AddComplianceWatch ¶ added in v0.2.1
func AddComplianceWatch(c controller.Controller) error
func AddConfigMapWatch ¶ added in v1.0.0
func AddConfigMapWatch(c controller.Controller, name, namespace string) error
func AddLogStorageWatch ¶ added in v1.0.0
func AddLogStorageWatch(c controller.Controller) error
func AddNetworkWatch ¶
func AddNetworkWatch(c controller.Controller) error
func AddSecretsWatch ¶ added in v1.0.0
func AddSecretsWatch(c controller.Controller, name, namespace string) error
func AutoDiscoverProvider ¶ added in v1.0.0
func AutoDiscoverProvider(cfg *rest.Config) (operatorv1.Provider, error)
func CheckLicenseKey ¶ added in v1.0.0
CheckLicenseKey checks if a license has been installed. It's useful to prevent rollout of TSEE components that might require it. It will return an error if the license is not installed, and nil otherwise.
func ClusterName ¶ added in v1.0.0
func ContextLoggerForResource ¶
ContextLoggerForResource provides a logger instance with context set for the provided object.
func ElasticsearchSecrets ¶ added in v1.0.0
func ElasticsearchSecrets(ctx context.Context, esUsernames []string, cli client.Client) ([]*corev1.Secret, error)
ElasticsearchSecrets gets the secrets needed for a component to be able to access Elasticsearch
func GetLogStorage ¶ added in v1.0.2
func GetLogStorage(ctx context.Context, cli client.Client) (*operatorv1.LogStorage, error)
func GetNetworkingPullSecrets ¶
func GetNetworkingPullSecrets(i *operatorv1.Installation, c client.Client) ([]*corev1.Secret, error)
func GetReadyLogStorage ¶ added in v1.0.0
func GetReadyLogStorage(ctx context.Context, cli client.Client) (*operatorv1.LogStorage, error)
GetLogStorage returns the LogStorage resource as the first return value if, and only if, it exists, it is "ready", and no error occurred, otherwise the first return value will be nil. If an error occurred it will be return as the second return value
func IgnoreObject ¶
IgnoreObject returns true if the object has been marked as ignored by the user, and returns false otherwise.
func IsLogStorageReady ¶ added in v1.0.0
func RandomPassword ¶ added in v1.0.0
func RequiresTigeraSecure ¶ added in v1.0.0
RequiresTigeraSecure determines if the configuration requires we start the tigera secure controllers.
func ValidateCertPair ¶
func ValidateCertPair(client client.Client, certPairSecretName, keyName, certName string) (*corev1.Secret, error)
ValidateCertPair checks if the given secret exists and if so that it contains key and cert fields. If a secret exists then it is returned. If there is an error accessing the secret (except NotFound) or the cert does not have both a key and cert field then an appropriate error is returned. If no secret exists then nil, nil is returned to represent that no cert is valid.