Documentation
¶
Index ¶
- Constants
- Variables
- func CacheOptions(logger logr.Logger, opts WatchOptions) cache.Options
- func GetWatchNamespacesFromEnv(logger logr.Logger, envVar string) map[string]cache.Config
- type CredentialChangeCallback
- type CredentialManager
- func (cm *CredentialManager) GetCredentials() (Creds, error)
- func (cm *CredentialManager) GetCredentialsForMetadata() (Creds, error)
- func (cm *CredentialManager) GetCredsWithDDAFallback(getDDA func() (*v2alpha1.DatadogAgent, error)) (Creds, error)
- func (cm *CredentialManager) RegisterCallback(cb CredentialChangeCallback)
- func (cm *CredentialManager) StartCredentialRefreshRoutine(interval time.Duration, logger logr.Logger)
- type Creds
- type WatchOptions
Constants ¶
const ( // AgentWatchNamespaceEnvVar is a comma-separated list of namespaces watched by the DatadogAgent controller. AgentWatchNamespaceEnvVar = "DD_AGENT_WATCH_NAMESPACE" // WatchNamespaceEnvVar is a comma-separated list of namespaces watched by all controllers, unless a controller-specific configuration is provided. // An empty value means the operator is running with cluster scope. WatchNamespaceEnvVar = "WATCH_NAMESPACE" )
Environment variable names for namespace watching configuration
Variables ¶
var ( // ErrEmptyAPIKey empty APIKey error ErrEmptyAPIKey = errors.New("empty api key") )
Functions ¶
func CacheOptions ¶ added in v1.8.0
func CacheOptions(logger logr.Logger, opts WatchOptions) cache.Options
CacheOptions function configures Controller Runtime cache options on a resource level (supported in v0.16+). Datadog CRDs and additional resources required for their reconciliation will be cached only if the respective feature is enabled.
Types ¶
type CredentialChangeCallback ¶ added in v1.21.0
type CredentialManager ¶ added in v0.6.0
type CredentialManager struct {
// contains filtered or unexported fields
}
CredentialManager provides the credentials from the operator configuration.
func NewCredentialManager ¶ added in v0.6.0
func NewCredentialManager(client client.Client) *CredentialManager
TODO deprecate in favor of NewCredentialManagerWithDecryptor NewCredentialManager returns a CredentialManager.
func NewCredentialManagerWithDecryptor ¶ added in v1.21.0
func NewCredentialManagerWithDecryptor(client client.Client, decryptor secrets.Decryptor) *CredentialManager
NewCredentialManager returns a CredentialManager.
func (*CredentialManager) GetCredentials ¶ added in v0.6.0
func (cm *CredentialManager) GetCredentials() (Creds, error)
GetCredentials returns the API and APP keys respectively from the operator configurations. This function tries to decrypt the secrets using the secret backend if needed. It returns an error if the creds aren't configured or if the secret backend fails to decrypt.
func (*CredentialManager) GetCredentialsForMetadata ¶ added in v1.23.0
func (cm *CredentialManager) GetCredentialsForMetadata() (Creds, error)
GetCredentialsForMetadata retrieves credentials for metadata endpoints. Only DD_API_KEY is required; DD_APP_KEY is optional since metadata endpoints don't require application keys for authentication.
func (*CredentialManager) GetCredsWithDDAFallback ¶ added in v1.21.0
func (cm *CredentialManager) GetCredsWithDDAFallback(getDDA func() (*v2alpha1.DatadogAgent, error)) (Creds, error)
GetCredsWithDDAFallback retrieves credentials for metadata endpoints with a three-tier fallback: 1. Operator environment variables (DD_API_KEY, DD_APP_KEY, DD_SITE, DD_URL) 2. ConfigMap-based credentials (Helm deployment with endpoint-config ConfigMap) 3. DatadogAgent custom resource Only DD_API_KEY is required; DD_APP_KEY is optional since this is exclusively used for metadata endpoints (/api/v1/metadata) which don't require application keys.
func (*CredentialManager) RegisterCallback ¶ added in v1.21.0
func (cm *CredentialManager) RegisterCallback(cb CredentialChangeCallback)
func (*CredentialManager) StartCredentialRefreshRoutine ¶ added in v1.21.0
func (cm *CredentialManager) StartCredentialRefreshRoutine(interval time.Duration, logger logr.Logger)