# README
Internal package
This package can't be included by external repositories.
We will maintain methods/functions here that should be shared between our different implementations (e.g. kubectl-fdb
and the controller
).
We mark these methods internal to prevent external usage, since we don't give any guarantees for backwards compatibility.
# Packages
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
# Functions
BuildOwnerReference returns an OwnerReference for the provided input.
ContainsPod checks if the given Pod is part of the cluster or not.
CreateDefaultBackup creates a defaultFoundationDBCluster for testing.
CreateDefaultCluster creates a default FoundationDBCluster for testing.
CreatePVCMap creates a map with the process group ID as a key and the according PVC as a value.
GenerateRandomString can be used to generate a random string with length n.
GetBackupDeployment builds a deployment for backup agents for a cluster.
GetBackupDeploymentName returns the name for the associated deployment for the FoundationDBBackup.
GetConfigMap builds a config map for a cluster's dynamic config.
GetConfigMapMonitorConfEntry returns the specific key for the monitor conf in the ConfigMap.
GetDynamicConfHash gets a hash of the data from the config map holding the cluster's dynamic conf.
GetEnvVars returns a HashMap of EnvVars for the container.
GetHeadlessService builds a headless service for a FoundationDB cluster.
GetImage returns the image for container.
GetImageType determines whether a pod is using the unified or the split image.
GetImageTypeFromAnnotation determines whether a pod is using the unified or the split image based on the annotations.
GetJSONHash serializes an object to JSON and takes a hash of the resulting JSON.
GetMonitorConf builds the monitor conf template.
GetMonitorProcessConfiguration builds the monitor conf template for the unified image.
GetObjectMetadata returns the ObjectMetadata for a process.
GetPod builds a pod for a new process group.
GetPodDNSName determines the fully qualified DNS name for a pod.
GetPodLabels creates the labels that we will apply to a Pod.
GetPodListOptions returns the listOptions to list Pods.
GetPodMatchLabels creates the labels that we will use when filtering for a pod.
GetPodMetadata returns the metadata for a specific Pod.
GetPodSpec builds a pod spec for a FoundationDB pod.
GetPodSpecHash builds the hash of the expected spec for a pod.
GetProcessClassFromMeta fetches the process class from an object's metadata.
GetProcessGroup is a helper method that creates a ProcessGroup based on the provided process class and id number.
GetProcessGroupIDFromMeta fetches the process group ID from an object's metadata.
GetProcessGroupIDFromPodName returns the process group ID for a given Pod name.
GetPublicIPsForPod returns the public IPs for a Pod.
GetPublicIPSource determines how a Pod has gotten its public IP.
GetPvc builds a persistent volume claim for a FoundationDB process group.
GetPvcMetadata returns the metadata for a PVC.
GetServersPerPodForPod returns the count of servers per Pod based on the processClass from the sidecar or 1.
GetService builds a service for a new process group.
GetSidecarImage returns the expected sidecar image for a specific process class.
GetSinglePodListOptions returns the listOptions to list a single Pod.
GetStartCommand builds the expected start command for a process group.
GetStartCommandWithSubstitutions will be used by GetStartCommand and for internal testing.
GetSubstitutionsFromClusterAndPod returns a map that contains the substitutions based on the provided cluster and Pod.
IsNetworkError returns true if the network is a network error net.Error.
IsQuotaExceeded returns true if the error returned by the Kubernetes API is a forbidden error with the error message that the quota was exceeded.
IsResourceNotDeleted returns true if provided error is of the type IsResourceNotDeleted.
IsTimeoutError returns true if the observed error was a timeout error.
NewCliLogFileCleaner returns a new CliLogFileCleaner.
NewFdbPodClient builds a client for working with an FDB Pod.
NormalizeClusterSpec converts a cluster spec into an unambiguous, future-proof form, by applying any implicit defaults and moving configuration from deprecated fields into fully-supported fields.
PickProcessGroups will pick a number of process groups for the specified process class.
PodHasSidecarTLS determines whether a pod currently has TLS enabled for the sidecar process.
ProcessClassFromLabels extracts the ProcessClass label from the metav1.ObjectMeta.Labels map.
SetupClusterForTest will generate all required resources like Pods for test cases.
# Constants
MockUnreachableAnnotation defines if a Pod should be unreachable.
# Structs
CliLogFileCleaner contains the logger and the minFileAge.
DeprecationOptions controls how deprecations and changes to defaults get applied to our specs.
NodeTaintChangedPredicate filters events before enqueuing the keys.
ResourceNotDeleted can be returned if the resource is not yet deleted.