Documentation
¶
Index ¶
- Constants
- func CheckInvariant(invariantName string, shutdownHooks *ShutdownHooks, threshold time.Duration, ...) error
- func FdbHexString(d []byte) string
- func FdbPrintable(d []byte) string
- func FdbStrinc(prefix []byte) ([]byte, error)
- func GenerateUpgradeTableEntries(options *FactoryOptions) []ginkgo.TableEntry
- func GetBaseImageAndTag(image string) (string, string)
- func GetDcIDsFromConfig(databaseConfiguration fdbv1beta2.DatabaseConfiguration) []string
- func GetOperatorSelector(namespace string) chaosmesh.PodSelectorSpec
- func GetProcessClass(pod corev1.Pod) fdbv1beta2.ProcessClass
- func GetProcessGroupID(pod corev1.Pod) fdbv1beta2.ProcessGroupID
- func GetPvc(pod *corev1.Pod) string
- func LoadControllerRuntimeFromContext(context string, configScheme *runtime.Scheme) (client.Client, error)
- func PodSelector(pod *corev1.Pod) chaosmesh.PodSelectorSpec
- func PodsSelector(v1pods []corev1.Pod) chaosmesh.PodSelectorSpec
- func RunGinkgoTests(t *testing.T, name string)
- func SetTestSuiteName(name string)
- func ToJSON(v any) string
- func Unprintable(val string) ([]byte, error)
- func VersionsAreProtocolCompatible(versionA string, versionB string) bool
- type ChaosMeshExperiment
- type ClusterConfig
- func (config *ClusterConfig) CalculateRoleCounts() fdbv1beta2.RoleCounts
- func (config *ClusterConfig) Copy() *ClusterConfig
- func (config *ClusterConfig) CreateDatabaseConfiguration() fdbv1beta2.DatabaseConfiguration
- func (config *ClusterConfig) GetRedundancyMode() fdbv1beta2.RedundancyMode
- func (config *ClusterConfig) GetUseUnifiedImage() bool
- func (config *ClusterConfig) GetVersion() string
- func (config *ClusterConfig) SetDefaults(ctx context.Context, factory *Factory)
- func (config *ClusterConfig) TLSEnabled() bool
- type CreationTrackerLogger
- type DataLoaderOptions
- type DefaultCreationTrackerLogger
- type Factory
- func (factory *Factory) AddShutdownHook(f func() error)
- func (factory *Factory) ChaosTestsEnabled() bool
- func (factory *Factory) ChooseRandomPod(pods *corev1.PodList) *corev1.Pod
- func (factory *Factory) CleanupChaosMeshExperiments(ctx context.Context) error
- func (factory *Factory) CreateBackupForCluster(ctx context.Context, fdbCluster *FdbCluster, config *FdbBackupConfiguration) *FdbBackup
- func (factory *Factory) CreateBackupForClusterFromSpec(ctx context.Context, spec *fdbv1beta2.FoundationDBBackup, ...) *FdbBackup
- func (factory *Factory) CreateBlobstoreIfAbsent(ctx context.Context, namespace string)
- func (factory *Factory) CreateDataLoaderIfAbsent(ctx context.Context, cluster *FdbCluster)
- func (factory *Factory) CreateDataLoaderIfAbsentWithOptions(ctx context.Context, cluster *FdbCluster, options *DataLoaderOptions)
- func (factory *Factory) CreateEncryptionKeySecret(ctx context.Context, namespace string)
- func (factory *Factory) CreateExperiment(ctx context.Context, chaos client.Object) *ChaosMeshExperiment
- func (factory *Factory) CreateFDBOperatorIfAbsent(ctx context.Context, namespace string) error
- func (factory *Factory) CreateFdbCluster(ctx context.Context, config *ClusterConfig) *FdbCluster
- func (factory *Factory) CreateFdbClusterFromSpec(ctx context.Context, spec *fdbv1beta2.FoundationDBCluster, ...) *FdbCluster
- func (factory *Factory) CreateFdbHaCluster(ctx context.Context, config *ClusterConfig) *HaFdbCluster
- func (factory *Factory) CreateIfAbsent(ctx context.Context, object client.Object) error
- func (factory *Factory) CreateRestoreForCluster(ctx context.Context, backup *FdbBackup, backupVersion *uint64) *FdbRestore
- func (factory *Factory) Delete(ctx context.Context, object client.Object)
- func (factory *Factory) DeleteChaosMeshExperiment(ctx context.Context, experiment *ChaosMeshExperiment)
- func (factory *Factory) DeleteDataLoader(ctx context.Context, cluster *FdbCluster)
- func (factory *Factory) DeletePod(ctx context.Context, pod *corev1.Pod)
- func (factory *Factory) DoesPodExist(ctx context.Context, pod corev1.Pod) (bool, error)
- func (factory *Factory) DownloadFile(ctx context.Context, target *corev1.Pod, container string, src string, ...) error
- func (factory *Factory) DumpOperatorLogs(ctx context.Context, cluster *FdbCluster, logsSinceSeconds *int64, ...)
- func (factory *Factory) DumpState(ctx context.Context, fdbCluster *FdbCluster)
- func (factory *Factory) DumpStateHaCluster(ctx context.Context, fdbCluster *HaFdbCluster)
- func (factory *Factory) DumpStateHaClusterWithLogsSince(ctx context.Context, fdbCluster *HaFdbCluster, logsSinceSeconds *int64)
- func (factory *Factory) DumpStateWithLogsSince(ctx context.Context, fdbCluster *FdbCluster, logsSinceSeconds *int64)
- func (factory *Factory) ExecuteCmd(ctx context.Context, namespace string, name string, container string, ...) (string, string, error)
- func (factory *Factory) ExecuteCmdOnPod(ctx context.Context, pod *corev1.Pod, container string, command string, ...) (string, string, error)
- func (factory *Factory) ExecuteCommandRaw(ctx context.Context, namespace string, name string, container string, ...) error
- func (factory *Factory) GenerateBackupSpecForCluster(fdbCluster *FdbCluster, config *FdbBackupConfiguration) *fdbv1beta2.FoundationDBBackup
- func (factory *Factory) GenerateCertificate() (*corev1.Secret, error)
- func (factory *Factory) GenerateFDBClusterSpec(ctx context.Context, config *ClusterConfig) *fdbv1beta2.FoundationDBCluster
- func (factory *Factory) GetAdditionalSidecarVersions() []fdbv1beta2.Version
- func (factory *Factory) GetBackupSecretName() string
- func (factory *Factory) GetChaosNamespace() string
- func (factory *Factory) GetContext() string
- func (factory *Factory) GetControllerRuntimeClient() client.Client
- func (factory *Factory) GetDataLoaderImage() string
- func (factory *Factory) GetDefaultLabels() map[string]string
- func (factory *Factory) GetDefaultStorageClass(ctx context.Context) string
- func (factory *Factory) GetDefaultUnavailableThreshold() time.Duration
- func (factory *Factory) GetEncryptionKeySecretName() string
- func (factory *Factory) GetFDBVersion() fdbv1beta2.Version
- func (factory *Factory) GetFoundationDBImage() string
- func (factory *Factory) GetLogsForPod(ctx context.Context, pod *corev1.Pod, container string, since *int64) string
- func (factory *Factory) GetMainContainerOverrides(config *ClusterConfig) fdbv1beta2.ContainerOverrides
- func (factory *Factory) GetNodeSelector() string
- func (factory *Factory) GetOperatorImage() string
- func (factory *Factory) GetOperatorPods(ctx context.Context, namespace string) *corev1.PodList
- func (factory *Factory) GetOperatorPodsWithOptions(ctx context.Context, namespace string, options ...client.ListOption) *corev1.PodList
- func (factory *Factory) GetPod(ctx context.Context, namespace string, name string) (*corev1.Pod, error)
- func (factory *Factory) GetSecretName() string
- func (factory *Factory) GetSidecarConfigs() []SidecarConfig
- func (factory *Factory) GetSidecarContainerOverrides(config *ClusterConfig) fdbv1beta2.ContainerOverrides
- func (factory *Factory) GetSidecarImage() string
- func (factory *Factory) GetStorageClasses(ctx context.Context, labels map[string]string) *storagev1.StorageClassList
- func (factory *Factory) GetSynchronizationMode() fdbv1beta2.SynchronizationMode
- func (factory *Factory) GetUnifiedFoundationDBImage() string
- func (factory *Factory) GetUpgradeVersions() []*UpgradeTestConfiguration
- func (factory *Factory) InjectDiskFailure(ctx context.Context, selector chaosmesh.PodSelectorSpec) *ChaosMeshExperiment
- func (factory *Factory) InjectDiskFailureWithDuration(ctx context.Context, selector chaosmesh.PodSelectorSpec, duration string) *ChaosMeshExperiment
- func (factory *Factory) InjectDiskFailureWithPath(ctx context.Context, selector chaosmesh.PodSelectorSpec, volumePath string, ...) *ChaosMeshExperiment
- func (factory *Factory) InjectDiskFailureWithPathAndDuration(ctx context.Context, selector chaosmesh.PodSelectorSpec, volumePath string, ...) *ChaosMeshExperiment
- func (factory *Factory) InjectHTTPClientChaosWrongResultFdbMonitorConf(ctx context.Context, selector chaosmesh.PodSelectorSpec, namespace string) *ChaosMeshExperiment
- func (factory *Factory) InjectIOLatency(ctx context.Context, selector chaosmesh.PodSelectorSpec, delay string) *ChaosMeshExperiment
- func (factory *Factory) InjectNetworkLatency(ctx context.Context, source chaosmesh.PodSelectorSpec, ...) *ChaosMeshExperiment
- func (factory *Factory) InjectNetworkLoss(ctx context.Context, lossPercentage string, source chaosmesh.PodSelectorSpec, ...) *ChaosMeshExperiment
- func (factory *Factory) InjectNetworkLossBetweenPods(ctx context.Context, pods []chaosmesh.PodSelectorSpec, loss string)
- func (factory *Factory) InjectPartition(ctx context.Context, selector chaosmesh.PodSelectorSpec) *ChaosMeshExperiment
- func (factory *Factory) InjectPartitionBetween(ctx context.Context, source chaosmesh.PodSelectorSpec, ...) *ChaosMeshExperiment
- func (factory *Factory) InjectPartitionBetweenWithDirection(ctx context.Context, source chaosmesh.PodSelectorSpec, ...) *ChaosMeshExperiment
- func (factory *Factory) InjectPartitionOnSomeTargetPods(ctx context.Context, source chaosmesh.PodSelectorSpec, ...) *ChaosMeshExperiment
- func (factory *Factory) InjectPartitionWithExternalTargets(ctx context.Context, selector chaosmesh.PodSelectorSpec, ...) *ChaosMeshExperiment
- func (factory *Factory) InjectPodStress(ctx context.Context, target chaosmesh.PodSelectorSpec, containerNames []string, ...) *ChaosMeshExperiment
- func (factory *Factory) Intn(n int) int
- func (factory *Factory) MultipleNamespaces(ctx context.Context, config *ClusterConfig, dcIDs []string) []string
- func (factory *Factory) OperatorIsAtLeast(version string) bool
- func (factory *Factory) PrependRegistry(container string) string
- func (factory *Factory) RandStringRunes(n int) string
- func (factory *Factory) RandomPickCluster(input []*FdbCluster, count int) []*FdbCluster
- func (factory *Factory) RandomPickOneCluster(input []*FdbCluster) *FdbCluster
- func (factory *Factory) RandomPickOnePod(input []corev1.Pod) corev1.Pod
- func (factory *Factory) RandomPickPod(input []corev1.Pod, count int) []corev1.Pod
- func (factory *Factory) RecreateOperatorPods(ctx context.Context, namespace string)
- func (factory *Factory) ScheduleInjectPodKill(ctx context.Context, target chaosmesh.PodSelectorSpec, schedule string, ...) *ChaosMeshExperiment
- func (factory *Factory) ScheduleInjectPodKillWithName(ctx context.Context, target chaosmesh.PodSelectorSpec, schedule string, ...) *ChaosMeshExperiment
- func (factory *Factory) SetFinalizerForPod(ctx context.Context, pod *corev1.Pod, finalizers []string)
- func (factory *Factory) Shutdown(ctx context.Context)
- func (factory *Factory) SingleNamespace(ctx context.Context) string
- func (factory *Factory) StopInvariantCheck()
- func (factory *Factory) UploadFile(ctx context.Context, target *corev1.Pod, container string, src io.Reader, ...) error
- func (factory *Factory) UseUnifiedImage() bool
- func (factory *Factory) WaitUntilDataLoaderIsDone(ctx context.Context, cluster *FdbCluster)
- func (factory *Factory) WaitUntilOperatorPodsRunning(ctx context.Context, namespace string)
- type FactoryOptions
- type FdbBackup
- func (fdbBackup *FdbBackup) Destroy(ctx context.Context)
- func (fdbBackup *FdbBackup) ForceReconcile(ctx context.Context)
- func (fdbBackup *FdbBackup) GetBackup(ctx context.Context) *fdbv1beta2.FoundationDBBackup
- func (fdbBackup *FdbBackup) GetBackupPod(ctx context.Context) *corev1.Pod
- func (fdbBackup *FdbBackup) GetBackupPods(ctx context.Context) *corev1.PodList
- func (fdbBackup *FdbBackup) Pause(ctx context.Context)
- func (fdbBackup *FdbBackup) RunAbortCommand(ctx context.Context)
- func (fdbBackup *FdbBackup) RunCommandOnBackupPod(ctx context.Context, command string) string
- func (fdbBackup *FdbBackup) RunDescribeCommand(ctx context.Context) *fdbv1beta2.FoundationDBBackupDescribe
- func (fdbBackup *FdbBackup) RunExpireCommand(ctx context.Context, expireBeforeVersion uint64) string
- func (fdbBackup *FdbBackup) RunListCommand(ctx context.Context) []string
- func (fdbBackup *FdbBackup) RunStatusCommand(ctx context.Context) *fdbv1beta2.FoundationDBLiveBackupStatus
- func (fdbBackup *FdbBackup) SetSnapshotInterval(ctx context.Context, snapshotPeriodSeconds int)
- func (fdbBackup *FdbBackup) Start(ctx context.Context)
- func (fdbBackup *FdbBackup) Stop(ctx context.Context)
- func (fdbBackup *FdbBackup) UpdateBackupSpec()
- func (fdbBackup *FdbBackup) UpdateBackupSpecWithSpec(desiredSpec *fdbv1beta2.FoundationDBBackupSpec)
- func (fdbBackup *FdbBackup) WaitForReconciliation(ctx context.Context)
- func (fdbBackup *FdbBackup) WaitForRestorableVersion(ctx context.Context, version uint64) uint64
- type FdbBackupConfiguration
- type FdbCluster
- func (fdbCluster *FdbCluster) AllProcessGroupsHaveCondition(ctx context.Context, condition fdbv1beta2.ProcessGroupConditionType, ...) bool
- func (fdbCluster *FdbCluster) BounceClusterWithoutWait(ctx context.Context) error
- func (fdbCluster *FdbCluster) CheckPodIsDeleted(ctx context.Context, podName string) bool
- func (fdbCluster *FdbCluster) ClearBuggifyNoSchedule(ctx context.Context, waitForReconcile bool) error
- func (fdbCluster *FdbCluster) ClearProcessGroupsToRemove(ctx context.Context) error
- func (fdbCluster *FdbCluster) ClearRange(ctx context.Context, prefixBytes []byte, timeout int)
- func (fdbCluster *FdbCluster) Create(ctx context.Context) error
- func (fdbCluster *FdbCluster) CreateTesterDeployment(ctx context.Context, replicas int) *appsv1.Deployment
- func (fdbCluster *FdbCluster) Destroy(ctx context.Context) error
- func (fdbCluster *FdbCluster) DestroyWithWaitForTearDown(ctx context.Context, waitForTearDown bool) error
- func (fdbCluster *FdbCluster) EnsurePodIsDeleted(ctx context.Context, podName string)
- func (fdbCluster *FdbCluster) EnsurePodIsDeletedWithCustomTimeout(ctx context.Context, podName string, timeoutMinutes int)
- func (fdbCluster *FdbCluster) EnsureTeamTrackersAreHealthy(ctx context.Context)
- func (fdbCluster *FdbCluster) EnsureTeamTrackersHaveMinReplicas(ctx context.Context)
- func (fdbCluster *FdbCluster) ExecuteCmdOnPod(ctx context.Context, pod corev1.Pod, container string, command string, ...) (string, string, error)
- func (fdbCluster *FdbCluster) ForceReconcile(ctx context.Context)
- func (fdbCluster *FdbCluster) GenerateRandomValues(n int, prefix byte) []KeyValue
- func (fdbCluster *FdbCluster) GetAllPods(ctx context.Context) *corev1.PodList
- func (fdbCluster *FdbCluster) GetAutomationOptions() fdbv1beta2.FoundationDBClusterAutomationOptions
- func (fdbCluster *FdbCluster) GetCachedCluster() *fdbv1beta2.FoundationDBCluster
- func (fdbCluster *FdbCluster) GetCluster(ctx context.Context) *fdbv1beta2.FoundationDBCluster
- func (fdbCluster *FdbCluster) GetClusterSpec(ctx context.Context) fdbv1beta2.FoundationDBClusterSpec
- func (fdbCluster *FdbCluster) GetClusterVersion(ctx context.Context) uint64
- func (fdbCluster *FdbCluster) GetCommandlineForProcessesPerClass(ctx context.Context) map[fdbv1beta2.ProcessClass][]string
- func (fdbCluster *FdbCluster) GetCommandlineForProcessesPerClassWithStatus(status *fdbv1beta2.FoundationDBStatus) map[fdbv1beta2.ProcessClass][]string
- func (fdbCluster *FdbCluster) GetCoordinators(ctx context.Context) []corev1.Pod
- func (fdbCluster *FdbCluster) GetCoordinatorsOnLogProcesses(ctx context.Context) []corev1.Pod
- func (fdbCluster *FdbCluster) GetCustomParameters(processClass fdbv1beta2.ProcessClass) fdbv1beta2.FoundationDBCustomParameters
- func (fdbCluster *FdbCluster) GetFDBImage(ctx context.Context) string
- func (fdbCluster *FdbCluster) GetListOfUIDsFromVolumeClaims(ctx context.Context, processClass fdbv1beta2.ProcessClass) []types.UID
- func (fdbCluster *FdbCluster) GetLogPods(ctx context.Context) *corev1.PodList
- func (fdbCluster *FdbCluster) GetLogServersPerPod() int
- func (fdbCluster *FdbCluster) GetNode(ctx context.Context, name string) *corev1.Node
- func (fdbCluster *FdbCluster) GetPod(ctx context.Context, name string) *corev1.Pod
- func (fdbCluster *FdbCluster) GetPodIDs(ctx context.Context, processClass fdbv1beta2.ProcessClass) map[fdbv1beta2.ProcessGroupID]fdbv1beta2.None
- func (fdbCluster *FdbCluster) GetPodRoleMap(ctx context.Context) map[fdbv1beta2.ProcessGroupID][]RoleInfo
- func (fdbCluster *FdbCluster) GetPodTemplateSpec(processClass fdbv1beta2.ProcessClass) *corev1.PodSpec
- func (fdbCluster *FdbCluster) GetPods(ctx context.Context) *corev1.PodList
- func (fdbCluster *FdbCluster) GetPodsNames(ctx context.Context) []string
- func (fdbCluster *FdbCluster) GetPodsWithRole(ctx context.Context, role fdbv1beta2.ProcessRole) []corev1.Pod
- func (fdbCluster *FdbCluster) GetProcessCount(ctx context.Context, targetRole fdbv1beta2.ProcessRole) int
- func (fdbCluster *FdbCluster) GetProcessCountByProcessClass(ctx context.Context, pClass fdbv1beta2.ProcessClass) int
- func (fdbCluster *FdbCluster) GetProcessCounts() (fdbv1beta2.ProcessCounts, error)
- func (fdbCluster *FdbCluster) GetProcessSettings(processClass fdbv1beta2.ProcessClass) *fdbv1beta2.ProcessSettings
- func (fdbCluster *FdbCluster) GetRange(ctx context.Context, prefixBytes []byte, limit int, timeout int) (keyValues []KeyValue)
- func (fdbCluster *FdbCluster) GetResourceLabels() map[string]string
- func (fdbCluster *FdbCluster) GetServices(ctx context.Context) *corev1.ServiceList
- func (fdbCluster *FdbCluster) GetSidecarImageForVersion(ctx context.Context, version string) string
- func (fdbCluster *FdbCluster) GetStatelessPods(ctx context.Context) *corev1.PodList
- func (fdbCluster *FdbCluster) GetStatus(ctx context.Context) *fdbv1beta2.FoundationDBStatus
- func (fdbCluster *FdbCluster) GetStoragePods(ctx context.Context) *corev1.PodList
- func (fdbCluster *FdbCluster) GetStorageServerPerPod() int
- func (fdbCluster *FdbCluster) GetVolumeClaimsForProcesses(ctx context.Context, processClass fdbv1beta2.ProcessClass) *corev1.PersistentVolumeClaimList
- func (fdbCluster *FdbCluster) GetVolumeSize(processClass fdbv1beta2.ProcessClass) resource.Quantity
- func (fdbCluster *FdbCluster) HasHeadlessService() bool
- func (fdbCluster *FdbCluster) HasTLSEnabled(ctx context.Context) bool
- func (fdbCluster *FdbCluster) InvariantClusterStatusAvailable() error
- func (fdbCluster *FdbCluster) InvariantClusterStatusAvailableWithThreshold(availabilityThreshold time.Duration) error
- func (fdbCluster *FdbCluster) IsAvailable(ctx context.Context) bool
- func (fdbCluster *FdbCluster) Name() string
- func (fdbCluster *FdbCluster) Namespace() string
- func (fdbCluster *FdbCluster) ReplacePod(ctx context.Context, pod corev1.Pod, waitForReconcile bool)
- func (fdbCluster *FdbCluster) ReplacePods(ctx context.Context, pods []corev1.Pod, waitForReconcile bool)
- func (fdbCluster *FdbCluster) RunFdbBackupCommandInOperatorWithoutRetry(ctx context.Context, command string, printOutput bool) (string, string, error)
- func (fdbCluster *FdbCluster) RunFdbCliCommandInOperator(ctx context.Context, command string, printOutput bool, timeout int) (string, string)
- func (fdbCluster *FdbCluster) RunFdbCliCommandInOperatorWithoutRetry(ctx context.Context, command string, printOutput bool, timeout int) (string, string, error)
- func (fdbCluster *FdbCluster) SetAutoReplacements(ctx context.Context, enabled bool, detectionTime time.Duration) error
- func (fdbCluster *FdbCluster) SetAutoReplacementsWithWait(ctx context.Context, enabled bool, detectionTime time.Duration, wait bool) error
- func (fdbCluster *FdbCluster) SetBuggifyBlockRemoval(ctx context.Context, blockRemovals []fdbv1beta2.ProcessGroupID)
- func (fdbCluster *FdbCluster) SetClusterTaintConfig(ctx context.Context, taintOption []fdbv1beta2.TaintReplacementOption, ...)
- func (fdbCluster *FdbCluster) SetCrashLoopContainers(ctx context.Context, crashLoopContainers []fdbv1beta2.CrashLoopContainerObject, ...)
- func (fdbCluster *FdbCluster) SetCustomParameters(ctx context.Context, ...) error
- func (fdbCluster *FdbCluster) SetDatabaseConfiguration(ctx context.Context, config fdbv1beta2.DatabaseConfiguration, ...) error
- func (fdbCluster *FdbCluster) SetFinalizerForPvc(ctx context.Context, finalizers []string, pvc corev1.PersistentVolumeClaim) error
- func (fdbCluster *FdbCluster) SetIgnoreDuringRestart(ctx context.Context, processes []fdbv1beta2.ProcessGroupID)
- func (fdbCluster *FdbCluster) SetIgnoreMissingProcessesSeconds(ctx context.Context, duration time.Duration)
- func (fdbCluster *FdbCluster) SetKillProcesses(ctx context.Context, allowKill bool, wait bool)
- func (fdbCluster *FdbCluster) SetLogServersPerPod(ctx context.Context, serverPerPod int, waitForReconcile bool) error
- func (fdbCluster *FdbCluster) SetPodAsUnschedulable(ctx context.Context, pod corev1.Pod)
- func (fdbCluster *FdbCluster) SetPodTemplateSpec(ctx context.Context, processClass fdbv1beta2.ProcessClass, ...) error
- func (fdbCluster *FdbCluster) SetProcessGroupPrefix(ctx context.Context, prefix string) error
- func (fdbCluster *FdbCluster) SetProcessGroupsAsUnschedulable(ctx context.Context, processGroups []fdbv1beta2.ProcessGroupID)
- func (fdbCluster *FdbCluster) SetPublicIPSource(ctx context.Context, publicIPSource fdbv1beta2.PublicIPSource) error
- func (fdbCluster *FdbCluster) SetSkipReconciliation(ctx context.Context, skip bool)
- func (fdbCluster *FdbCluster) SetStorageServerPerPod(ctx context.Context, serverPerPod int) error
- func (fdbCluster *FdbCluster) SetTLS(ctx context.Context, enableMainContainerTLS bool, ...) error
- func (fdbCluster *FdbCluster) SetUseDNSInClusterFile(ctx context.Context, useDNSInClusterFile bool) error
- func (fdbCluster *FdbCluster) SetVolumeSize(ctx context.Context, processClass fdbv1beta2.ProcessClass, ...) error
- func (fdbCluster *FdbCluster) StatusInvariantChecker(name string, threshold time.Duration, ...) error
- func (fdbCluster *FdbCluster) Update(ctx context.Context) error
- func (fdbCluster *FdbCluster) UpdateAnnotationsAndLabels(ctx context.Context, annotations map[string]string, labels map[string]string)
- func (fdbCluster *FdbCluster) UpdateClusterSpec(ctx context.Context)
- func (fdbCluster *FdbCluster) UpdateClusterSpecWithSpec(ctx context.Context, desiredSpec *fdbv1beta2.FoundationDBClusterSpec)
- func (fdbCluster *FdbCluster) UpdateClusterStatus(ctx context.Context)
- func (fdbCluster *FdbCluster) UpdateClusterStatusWithStatus(ctx context.Context, desiredStatus *fdbv1beta2.FoundationDBClusterStatus)
- func (fdbCluster *FdbCluster) UpdateConnectionString(ctx context.Context, connectionString string)
- func (fdbCluster *FdbCluster) UpdateContainerImage(ctx context.Context, pod *corev1.Pod, containerName string, image string)
- func (fdbCluster *FdbCluster) UpdateCoordinatorSelection(ctx context.Context, setting []fdbv1beta2.CoordinatorSelectionSetting) error
- func (fdbCluster *FdbCluster) UpdateLogProcessCount(ctx context.Context, newLogProcessCount int) error
- func (fdbCluster *FdbCluster) UpdateNode(ctx context.Context, node *corev1.Node)
- func (fdbCluster *FdbCluster) UpdateStorageClass(ctx context.Context, storageClass string, processClass fdbv1beta2.ProcessClass) error
- func (fdbCluster *FdbCluster) UpgradeAndVerify(ctx context.Context, version string)
- func (fdbCluster *FdbCluster) UpgradeCluster(ctx context.Context, version string, waitForReconciliation bool) error
- func (fdbCluster *FdbCluster) ValidateProcessesCount(ctx context.Context, processClass fdbv1beta2.ProcessClass, ...)
- func (fdbCluster *FdbCluster) VerifyVersion(ctx context.Context, version string)
- func (fdbCluster *FdbCluster) WaitForPodRemoval(ctx context.Context, pod *corev1.Pod)
- func (fdbCluster *FdbCluster) WaitForReconciliation(ctx context.Context, options ...func(*ReconciliationOptions)) error
- func (fdbCluster *FdbCluster) WaitUntilAvailable(ctx context.Context)
- func (fdbCluster *FdbCluster) WaitUntilExists(ctx context.Context)
- func (fdbCluster *FdbCluster) WaitUntilWithForceReconcile(ctx context.Context, pollTimeInSeconds int, timeOutInSeconds int, ...) error
- func (fdbCluster *FdbCluster) WriteKeyValue(ctx context.Context, keyValue KeyValue, timeout int)
- func (fdbCluster *FdbCluster) WriteKeyValues(ctx context.Context, keyValues []KeyValue)
- func (fdbCluster *FdbCluster) WriteKeyValuesWithTimeout(ctx context.Context, keyValues []KeyValue, timeout int)
- type FdbRestore
- type HaFdbCluster
- func (haFDBCluster *HaFdbCluster) Delete(ctx context.Context)
- func (haFDBCluster *HaFdbCluster) DumpState(ctx context.Context)
- func (haFDBCluster *HaFdbCluster) GetAllClusters() []*FdbCluster
- func (haFDBCluster *HaFdbCluster) GetCluster(suffix string) *FdbCluster
- func (haFDBCluster *HaFdbCluster) GetNamespaceSelector() chaosmesh.PodSelectorSpec
- func (haFDBCluster *HaFdbCluster) GetNamespaces() []string
- func (haFDBCluster *HaFdbCluster) GetPrimary() *FdbCluster
- func (haFDBCluster *HaFdbCluster) GetPrimarySatellite() *FdbCluster
- func (haFDBCluster *HaFdbCluster) GetRemote() *FdbCluster
- func (haFDBCluster *HaFdbCluster) GetRemoteSatellite() *FdbCluster
- func (haFDBCluster *HaFdbCluster) GetSatellite() *FdbCluster
- func (haFDBCluster *HaFdbCluster) SetCustomParameters(ctx context.Context, ...) error
- func (haFDBCluster *HaFdbCluster) SetDatabaseConfiguration(ctx context.Context, config fdbv1beta2.DatabaseConfiguration)
- func (haFDBCluster *HaFdbCluster) UpgradeCluster(ctx context.Context, version string, waitForReconciliation bool) error
- func (haFDBCluster *HaFdbCluster) UpgradeClusterWithTimeout(ctx context.Context, version string, waitForReconciliation bool, timeout int) error
- func (haFDBCluster *HaFdbCluster) VerifyVersion(ctx context.Context, version string)
- func (haFDBCluster *HaFdbCluster) WaitForReconciliation(ctx context.Context, options ...func(*ReconciliationOptions)) error
- type HaMode
- type KeyValue
- type ReconciliationOption
- func CreationTrackerLoggerOption(creationTrackerLogger CreationTrackerLogger) ReconciliationOption
- func MinimumGenerationOption(minimumGeneration int64) ReconciliationOption
- func PollTimeInSecondsOption(pollTimeInSeconds int) ReconciliationOption
- func SoftReconcileOption(enable bool) ReconciliationOption
- func TimeOutInSecondsOption(timeOutInSeconds int) ReconciliationOption
- type ReconciliationOptions
- type RoleInfo
- type ShutdownHooks
- type SidecarConfig
- type UpgradeTestConfiguration
Constants ¶
const ( // PrimaryID is the suffix for the primary FoundationDBCluster PrimaryID = "primary" // RemoteID is the suffix for the remote FoundationDBCluster RemoteID = "remote" // PrimarySatelliteID is the suffix for the primary satellite FoundationDBCluster PrimarySatelliteID = "primary-sat" // RemoteSatelliteID is the suffix for the remote satellite FoundationDBCluster RemoteSatelliteID = "remote-sat" // SatelliteID is the suffix for the satellite FoundationDBCluster SatelliteID = "sat" )
This file contains fixtures to set up HA configurations.
const ChaosDurationForever = "998h"
ChaosDurationForever represents a very long duration if an experiment should run for the whole test duration.
Variables ¶
This section is empty.
Functions ¶
func CheckInvariant ¶
func CheckInvariant( invariantName string, shutdownHooks *ShutdownHooks, threshold time.Duration, f func() error, ) error
CheckInvariant will test the invariant method provided and will return an error if the invariant returns an error
func FdbHexString ¶ added in v2.20.0
FdbHexString returns a string where bytes are replaced with \x followed by a two character zero-padded hex code for byte.
func FdbPrintable ¶
FdbPrintable copied from foundationdb bindings/go/src/fdb/fdb.go func Printable(d []byte) string Printable returns a human-readable version of a byte array. The bytes that correspond with ASCII printable characters [32-127) are passed through. Other bytes are replaced with \x followed by a two character zero-padded hex code for byte.
func FdbStrinc ¶
FdbStrinc returns the first key that would sort outside the range prefixed by // prefix, or an error if prefix is empty or contains only 0xFF bytes. Copied from foundationdb bindings/go/src/fdb/range.go func Strinc(prefix []byte) ([]byte, error)
func GenerateUpgradeTableEntries ¶
func GenerateUpgradeTableEntries(options *FactoryOptions) []ginkgo.TableEntry
GenerateUpgradeTableEntries creates the ginkgo.TableEntry slice based of the provided options.
func GetBaseImageAndTag ¶
GetBaseImageAndTag returns the base image and if present the tag.
func GetDcIDsFromConfig ¶
func GetDcIDsFromConfig(databaseConfiguration fdbv1beta2.DatabaseConfiguration) []string
GetDcIDsFromConfig returns unique DC IDs from the current config. TODO (johscheuer): Should this be part of v1beta2?
func GetOperatorSelector ¶
func GetOperatorSelector(namespace string) chaosmesh.PodSelectorSpec
GetOperatorSelector returns the operator Pod selector for chaos mesh.
func GetProcessClass ¶
func GetProcessClass(pod corev1.Pod) fdbv1beta2.ProcessClass
GetProcessClass returns the Process class of this Pod.
func GetProcessGroupID ¶
func GetProcessGroupID(pod corev1.Pod) fdbv1beta2.ProcessGroupID
GetProcessGroupID returns the Process Group ID class of this Pod.
func LoadControllerRuntimeFromContext ¶
func LoadControllerRuntimeFromContext( context string, configScheme *runtime.Scheme, ) (client.Client, error)
LoadControllerRuntimeFromContext will load a client.Client from the provided context. The context must be existing in the kube config.
func PodSelector ¶
func PodSelector(pod *corev1.Pod) chaosmesh.PodSelectorSpec
PodSelector returns the PodSelectorSpec for the provided Pod.
func PodsSelector ¶
func PodsSelector(v1pods []corev1.Pod) chaosmesh.PodSelectorSpec
PodsSelector returns the PodSelectorSpec for the provided Pods.
func RunGinkgoTests ¶
RunGinkgoTests sets up the current test suite to run Ginkgo tests, then invokes the tests. It should be invoked by each top level Test* function.
func SetTestSuiteName ¶
func SetTestSuiteName(name string)
SetTestSuiteName will set the test suite name for the current test suite. You have to ensure that this test suite name is unique across all test suites.
func Unprintable ¶
Unprintable adapted from foundationdb fdbclient/NativeAPI.actor.cpp std::string unprintable(std::string const& val).
func VersionsAreProtocolCompatible ¶
VersionsAreProtocolCompatible returns true if versionA and versionB are protocol compatible e.g. a patch upgrade.
Types ¶
type ChaosMeshExperiment ¶
type ChaosMeshExperiment struct {
// contains filtered or unexported fields
}
ChaosMeshExperiment is a wrapper around an actual chaos mesh experiment and should provide some useful abstractions, to make it easier to run experiments.
type ClusterConfig ¶
type ClusterConfig struct {
// If enabled we will use the performance setup.
Performance bool
// If enabled the debug images will be used for this test case.
DebugSymbols bool
// UseMaintenanceMode if enabled the FoundationDBCluster resource will enable the maintenance mode.
UseMaintenanceMode bool
// EnableTLS when set this value will be used to enable/disable TLS, the default is true.
EnableTLS *bool
// UseLocalityBasedExclusions if enabled the FoundationDBCluster resource will enable the locality based exclusions.
UseLocalityBasedExclusions *bool
// UseDNS if enabled the FoundationDBCluster resource will enable the DNS feature.
UseDNS *bool
// If enabled the cluster will be setup with the unified image.
UseUnifiedImage *bool
// ManagementAPI if set to true, the operator will make use of the management API.
ManagementAPI *bool
// SimulateCustomFaultDomainEnv will simulate the use case that a user has set a custom environment variable to
// be used as zone ID.
SimulateCustomFaultDomainEnv bool
// CreationTracker if specified will be used to log the time between the creations steps.
CreationTracker CreationTrackerLogger
// Number of machines, this is used for calculating the number of Pods and is not correlated to the actual number
// of machines that will be used.
MachineCount int
// This is also used for calculating the number of Pods.
DisksPerMachine int
// StorageServerPerPod defines the value that is set in the FoundationDBClusterSpec for this setting.
StorageServerPerPod int
// LogServersPerPod defines the value that is set in the FoundationDBClusterSpec for this setting.
LogServersPerPod int
// MemoryPerPodInGb defines the default memory for pods created by this cluster. If more than one process is running inside the
// pod the memory size will be increased proportionally. If not set, will default to 8Gi
MemoryPerPod string
// CpusPerPod defines the default CPU size for pods created by this cluster. If more than one process is running inside the
// pod the CPU size will be increased proportionally. If not set will default to 1.
CpusPerPod string
// VolumeSize the size of the volumes that should be created for stateful Pods.
VolumeSize string
// Namespace to create the cluster in, if empty will use a randomly generated namespace. The setup won't create the
// namespace if it's not created.
Namespace string
// Name of the cluster to be created, if empty a random name will be used.
Name string
// TLSPeerVerification represents the TLS peer verification that should be used for the cluster.
TLSPeerVerification string
// Version used to create the FDB cluster with.
Version *string
// The storage engine that should be used to create the cluster
StorageEngine fdbv1beta2.StorageEngine
// NodeSelector of the cluster to be created.
NodeSelector map[string]string
// Defines the HA mode that will be used, per default this will point to HaModeNone.
HaMode HaMode
// CustomParameters allows to define the custom parameters that should be set during the cluster creation.
CustomParameters map[fdbv1beta2.ProcessClass]fdbv1beta2.FoundationDBCustomParameters
// CreationCallback allows to specify a method that will be called after the cluster was created.
CreationCallback func(fdbCluster *FdbCluster)
// RedundancyMode defines the redundancy mode that should be used. If undefined the default is triple, except for
// the HaFourZoneDoubleSatRF4 configuration.
RedundancyMode fdbv1beta2.RedundancyMode
// SynchronizationMode defines the fdbv1beta2.SynchronizationMode if not set the default will be \"local\"
SynchronizationMode fdbv1beta2.SynchronizationMode
// contains filtered or unexported fields
}
ClusterConfig defines the target configuration for the FoundationDBCLuster.
func DefaultClusterConfig ¶
func DefaultClusterConfig(debugSymbols bool) *ClusterConfig
DefaultClusterConfig returns the default cluster configuration with the HA Mode None.
func DefaultClusterConfigWithHaMode ¶
func DefaultClusterConfigWithHaMode(haMode HaMode, debugSymbols bool) *ClusterConfig
DefaultClusterConfigWithHaMode returns the default cluster configuration with the provided HA Mode.
func (*ClusterConfig) CalculateRoleCounts ¶
func (config *ClusterConfig) CalculateRoleCounts() fdbv1beta2.RoleCounts
CalculateRoleCounts attempt to scale role counts in a way that is reasonable for read-heavy OLTP-style workloads 1 disk will hold logs. The rest holds data.
func (*ClusterConfig) Copy ¶
func (config *ClusterConfig) Copy() *ClusterConfig
Copy will return a new struct of the ClusterConfig.
func (*ClusterConfig) CreateDatabaseConfiguration ¶
func (config *ClusterConfig) CreateDatabaseConfiguration() fdbv1beta2.DatabaseConfiguration
CreateDatabaseConfiguration returns the fdbv1beta2.DatabaseConfiguration based on the provided cluster configuration.
func (*ClusterConfig) GetRedundancyMode ¶
func (config *ClusterConfig) GetRedundancyMode() fdbv1beta2.RedundancyMode
GetRedundancyMode returns the redundancy mode based on the cluster configuration.
func (*ClusterConfig) GetUseUnifiedImage ¶ added in v2.10.0
func (config *ClusterConfig) GetUseUnifiedImage() bool
GetUseUnifiedImage returns true when the unified image should be used.
func (*ClusterConfig) GetVersion ¶ added in v2.10.0
func (config *ClusterConfig) GetVersion() string
GetVersion returns the version to create the cluster with.
func (*ClusterConfig) SetDefaults ¶
func (config *ClusterConfig) SetDefaults(ctx context.Context, factory *Factory)
SetDefaults will set all unset fields to the default values.
func (*ClusterConfig) TLSEnabled ¶ added in v2.10.0
func (config *ClusterConfig) TLSEnabled() bool
TLSEnabled returns true when TLS should be enabled or false if TLS should be disabled.
type CreationTrackerLogger ¶
type CreationTrackerLogger interface {
// NewEntry adds an entry to the internal map.
NewEntry() map[string]any
// Log will write the values in the map directly to the logger.
Log(values map[string]any) error
// Flush will write all values from the entry map to the logger.
Flush() error
}
CreationTrackerLogger is an interface that can be used to log the time between different creation steps.
func NewDefaultCreationTrackerLogger ¶
func NewDefaultCreationTrackerLogger() CreationTrackerLogger
NewDefaultCreationTrackerLogger creates a no-op logger which is not writing anything.
type DataLoaderOptions ¶ added in v2.27.0
type DataLoaderOptions struct {
// Wait, if true the test suite will wait for the data loader to finish.
Wait bool
// DataLoaderArguments arguments to add to the data loader.
DataLoaderArguments []string
}
DataLoaderOptions can be used to define custom options to start the data loader
type DefaultCreationTrackerLogger ¶
type DefaultCreationTrackerLogger struct{}
DefaultCreationTrackerLogger is an implementation of CreationTrackerLogger that is not printing any values.
func (*DefaultCreationTrackerLogger) Flush ¶
func (logger *DefaultCreationTrackerLogger) Flush() error
Flush will write all values from the entry map to the logger.
func (*DefaultCreationTrackerLogger) Log ¶
func (logger *DefaultCreationTrackerLogger) Log(_ map[string]any) error
Log will write the values in the map directly to the logger.
func (*DefaultCreationTrackerLogger) NewEntry ¶
func (logger *DefaultCreationTrackerLogger) NewEntry() map[string]any
NewEntry adds an entry to the internal map.
type Factory ¶
type Factory struct {
// contains filtered or unexported fields
}
Factory is a helper struct to organize tests.
func CreateFactory ¶
func CreateFactory(options *FactoryOptions) *Factory
CreateFactory will create a factory based on the provided options.
func (*Factory) AddShutdownHook ¶
AddShutdownHook will add the provided shut down hook. Methods that are called by AddShutdownHook should not use the provided SpecContext as the context will be canceled after the Ginkgo node was executed. In another PR, we could pass a ctx to the invocation of the shutdown handlers. Right now a generic context.Background() is used to ensure that the cleanup methods will always be executed.
func (*Factory) ChaosTestsEnabled ¶
ChaosTestsEnabled returns true if chaos tests should be executed.
func (*Factory) ChooseRandomPod ¶
ChooseRandomPod returns a random pod from the provided array, passing through the provided error. TODO(johscheuer): Should we merge ChooseRandomPod and RandomPickOnePod?
func (*Factory) CleanupChaosMeshExperiments ¶
CleanupChaosMeshExperiments deletes any chaos experiments created by this handle. Invoked at shutdown. Tests that need to delete experiments should invoke Delete on their ChaosMeshExperiment objects.
func (*Factory) CreateBackupForCluster ¶
func (factory *Factory) CreateBackupForCluster( ctx context.Context, fdbCluster *FdbCluster, config *FdbBackupConfiguration, ) *FdbBackup
CreateBackupForCluster will create a FoundationDBBackup for the provided cluster.
func (*Factory) CreateBackupForClusterFromSpec ¶ added in v2.23.0
func (factory *Factory) CreateBackupForClusterFromSpec( ctx context.Context, spec *fdbv1beta2.FoundationDBBackup, fdbCluster *FdbCluster, ) *FdbBackup
CreateBackupForClusterFromSpec creates a FdbBackup. This method can be used in combination with the GenerateBackupSpecForCluster method. In general this should only be used for special cases that are not covered by changing the FdbBackupConfiguration.
func (*Factory) CreateBlobstoreIfAbsent ¶
CreateBlobstoreIfAbsent creates the blobstore Deployment based on the template.
func (*Factory) CreateDataLoaderIfAbsent ¶
func (factory *Factory) CreateDataLoaderIfAbsent(ctx context.Context, cluster *FdbCluster)
CreateDataLoaderIfAbsent will create the data loader for the provided cluster and load some random data into the cluster.
func (*Factory) CreateDataLoaderIfAbsentWithOptions ¶ added in v2.27.0
func (factory *Factory) CreateDataLoaderIfAbsentWithOptions( ctx context.Context, cluster *FdbCluster, options *DataLoaderOptions, )
CreateDataLoaderIfAbsentWithOptions will create the data loader for the provided cluster and load some random data into the cluster. If wait is true, the method will wait until the data loader has finished.
func (*Factory) CreateEncryptionKeySecret ¶ added in v2.15.0
CreateEncryptionKeySecret creates a 32-byte encryption key secret.
func (*Factory) CreateExperiment ¶
func (factory *Factory) CreateExperiment( ctx context.Context, chaos client.Object, ) *ChaosMeshExperiment
CreateExperiment creates a chaos experiment in the cluster with specified type, name and chaos object.
func (*Factory) CreateFDBOperatorIfAbsent ¶
CreateFDBOperatorIfAbsent creates the operator Deployment based on the template.
func (*Factory) CreateFdbCluster ¶
func (factory *Factory) CreateFdbCluster( ctx context.Context, config *ClusterConfig, ) *FdbCluster
CreateFdbCluster creates a FDB cluster.
func (*Factory) CreateFdbClusterFromSpec ¶
func (factory *Factory) CreateFdbClusterFromSpec( ctx context.Context, spec *fdbv1beta2.FoundationDBCluster, config *ClusterConfig, ) *FdbCluster
CreateFdbClusterFromSpec creates a FDB cluster. This method can be used in combination with the GenerateFDBClusterSpec method. In general this should only be used for special cases that are not covered by changing the ClusterOptions or the ClusterConfig.
func (*Factory) CreateFdbHaCluster ¶
func (factory *Factory) CreateFdbHaCluster( ctx context.Context, config *ClusterConfig, ) *HaFdbCluster
CreateFdbHaCluster creates a HA FDB Cluster based on the cluster config and cluster options
func (*Factory) CreateIfAbsent ¶
CreateIfAbsent will create the provided resource if absent.
func (*Factory) CreateRestoreForCluster ¶
func (factory *Factory) CreateRestoreForCluster( ctx context.Context, backup *FdbBackup, backupVersion *uint64, ) *FdbRestore
CreateRestoreForCluster will create a FoundationDBRestore resource based on the provided backup resource. For more information how the backup system with the operator is working please look at the operator documentation: https://github.com/FoundationDB/fdb-kubernetes-operator/blob/main/docs/manual/backup.md
func (*Factory) DeleteChaosMeshExperiment ¶ added in v2.22.0
func (factory *Factory) DeleteChaosMeshExperiment( ctx context.Context, experiment *ChaosMeshExperiment, )
DeleteChaosMeshExperiment will delete a running Chaos Mesh experiment.
func (*Factory) DeleteDataLoader ¶
func (factory *Factory) DeleteDataLoader(ctx context.Context, cluster *FdbCluster)
DeleteDataLoader will delete the data loader job
func (*Factory) DoesPodExist ¶
DoesPodExist checks to see if Kubernetes still knows about this pod.
func (*Factory) DownloadFile ¶
func (factory *Factory) DownloadFile( ctx context.Context, target *corev1.Pod, container string, src string, dst io.Writer) error
DownloadFile will download the file from the provided Pod/container into w.
func (*Factory) DumpOperatorLogs ¶ added in v2.32.0
func (factory *Factory) DumpOperatorLogs( ctx context.Context, cluster *FdbCluster, logsSinceSeconds *int64, printPodInfo bool, )
DumpOperatorLogs will write the operator logs for the specified time.
func (*Factory) DumpState ¶
func (factory *Factory) DumpState(ctx context.Context, fdbCluster *FdbCluster)
DumpState writes the state of the cluster to the log output. Useful for debugging test failures.
func (*Factory) DumpStateHaCluster ¶
func (factory *Factory) DumpStateHaCluster(ctx context.Context, fdbCluster *HaFdbCluster)
DumpStateHaCluster can be used to dump the state of the HA cluster. This includes the Kubernetes custom resource information as well as the operator logs and the Pod state.
func (*Factory) DumpStateHaClusterWithLogsSince ¶ added in v2.10.0
func (factory *Factory) DumpStateHaClusterWithLogsSince( ctx context.Context, fdbCluster *HaFdbCluster, logsSinceSeconds *int64, )
DumpStateHaClusterWithLogsSince can be used to dump the state of the HA cluster. This includes the Kubernetes custom resource information as well as the operator logs and the Pod state. The logsSinceSeconds is used for the manager logs from the operator.
func (*Factory) DumpStateWithLogsSince ¶ added in v2.10.0
func (factory *Factory) DumpStateWithLogsSince( ctx context.Context, fdbCluster *FdbCluster, logsSinceSeconds *int64, )
DumpStateWithLogsSince writes the state of the cluster to the log output. Useful for debugging test failures. The logsSinceSeconds is used for the manager logs from the operator.
func (*Factory) ExecuteCmd ¶
func (factory *Factory) ExecuteCmd( ctx context.Context, namespace string, name string, container string, command string, printOutput bool, ) (string, string, error)
ExecuteCmd executes command in the default container of a Pod with shell, returns stdout and stderr.
func (*Factory) ExecuteCmdOnPod ¶
func (factory *Factory) ExecuteCmdOnPod( ctx context.Context, pod *corev1.Pod, container string, command string, printOutput bool, ) (string, string, error)
ExecuteCmdOnPod runs a command on the provided Pod. The command will be executed inside a bash -c ”.
func (*Factory) ExecuteCommandRaw ¶
func (factory *Factory) ExecuteCommandRaw( ctx context.Context, namespace string, name string, container string, command []string, stdin io.Reader, stdout io.Writer, stderr io.Writer, isTty bool, ) error
ExecuteCommandRaw will run the command without putting it into a shell.
func (*Factory) GenerateBackupSpecForCluster ¶ added in v2.23.0
func (factory *Factory) GenerateBackupSpecForCluster( fdbCluster *FdbCluster, config *FdbBackupConfiguration, ) *fdbv1beta2.FoundationDBBackup
GenerateBackupSpecForCluster will generate the fdbv1beta2.FoundationDBBackup spec for the provided configuration and FdbCluster.
func (*Factory) GenerateCertificate ¶
GenerateCertificate generates a Kubernetes Secret that contains a valid certificate, key and ca.pem. This method can be used to create e2e test FDB clusters.
func (*Factory) GenerateFDBClusterSpec ¶
func (factory *Factory) GenerateFDBClusterSpec( ctx context.Context, config *ClusterConfig, ) *fdbv1beta2.FoundationDBCluster
GenerateFDBClusterSpec will generate a *fdbv1beta2.FoundationDBCluster based on the input ClusterConfig.
func (*Factory) GetAdditionalSidecarVersions ¶
func (factory *Factory) GetAdditionalSidecarVersions() []fdbv1beta2.Version
GetAdditionalSidecarVersions returns all additional FoundationDB versions that should be added to the sidecars. This method make sure that the operator has all required client libraries.
func (*Factory) GetBackupSecretName ¶
GetBackupSecretName returns the name of the backup secret.
func (*Factory) GetChaosNamespace ¶
GetChaosNamespace returns the chaos namespace that was provided per command line.
func (*Factory) GetContext ¶
GetContext returns the Kubernetes context provided via command line.
func (*Factory) GetControllerRuntimeClient ¶
GetControllerRuntimeClient returns the controller runtime client.
func (*Factory) GetDataLoaderImage ¶
GetDataLoaderImage returns the dataloader image provided via command line. If a registry was defined the registry will be prepended.
func (*Factory) GetDefaultLabels ¶
GetDefaultLabels returns the default labels set to all resources.
func (*Factory) GetDefaultStorageClass ¶
GetDefaultStorageClass returns either the StorageClass provided by the command line or fetches the StorageClass passed on the default Annotation.
func (*Factory) GetDefaultUnavailableThreshold ¶ added in v2.9.0
GetDefaultUnavailableThreshold returns the default unavailable threshold. If the cluster is unavailable for a longer period the test case will fail.
func (*Factory) GetEncryptionKeySecretName ¶ added in v2.15.0
GetEncryptionKeySecretName returns the name for the encryption key secret
func (*Factory) GetFDBVersion ¶
func (factory *Factory) GetFDBVersion() fdbv1beta2.Version
GetFDBVersion returns the parsed FDB version.
func (*Factory) GetFoundationDBImage ¶
GetFoundationDBImage returns the FoundationDB image provided via command line. If a registry was defined the registry will be prepended.
func (*Factory) GetLogsForPod ¶
func (factory *Factory) GetLogsForPod( ctx context.Context, pod *corev1.Pod, container string, since *int64, ) string
GetLogsForPod will fetch the logs for the specified Pod and container since the provided seconds.
func (*Factory) GetMainContainerOverrides ¶
func (factory *Factory) GetMainContainerOverrides( config *ClusterConfig, ) fdbv1beta2.ContainerOverrides
GetMainContainerOverrides will return the main container overrides.
func (*Factory) GetNodeSelector ¶ added in v2.2.0
GetNodeSelector returns the node selector, which is an empty string or has the format key=value.
func (*Factory) GetOperatorImage ¶
GetOperatorImage returns the operator image provided via command line. If a registry was defined the registry will be prepended.
func (*Factory) GetOperatorPods ¶
GetOperatorPods returns the operator Pods in the provided namespace.
func (*Factory) GetOperatorPodsWithOptions ¶ added in v2.11.0
func (factory *Factory) GetOperatorPodsWithOptions( ctx context.Context, namespace string, options ...client.ListOption, ) *corev1.PodList
GetOperatorPodsWithOptions returns the operator Pods in the provided namespace with the additional list options. The default list options contain the namespace selector and the label selector for the operator pods.
func (*Factory) GetPod ¶
func (factory *Factory) GetPod( ctx context.Context, namespace string, name string, ) (*corev1.Pod, error)
GetPod returns the Pod matching the namespace and name
func (*Factory) GetSecretName ¶
GetSecretName returns the secret name that contains the certificates used for the current test run.
func (*Factory) GetSidecarConfigs ¶
func (factory *Factory) GetSidecarConfigs() []SidecarConfig
GetSidecarConfigs returns the sidecar configs. The sidecar configs can be used to template applications that will use all provided sidecar versions to inject FDB client libraries.
func (*Factory) GetSidecarContainerOverrides ¶
func (factory *Factory) GetSidecarContainerOverrides( config *ClusterConfig, ) fdbv1beta2.ContainerOverrides
GetSidecarContainerOverrides will return the sidecar container overrides. If the unified image should be used an empty container override will be returned.
func (*Factory) GetSidecarImage ¶
GetSidecarImage returns the sidecar image provided via command line. If a registry was defined the registry will be prepended.
func (*Factory) GetStorageClasses ¶
func (factory *Factory) GetStorageClasses( ctx context.Context, labels map[string]string, ) *storagev1.StorageClassList
GetStorageClasses returns all StorageClasses present in this Kubernetes cluster that have the label foundationdb.org/operator-testing=true.
func (*Factory) GetSynchronizationMode ¶ added in v2.3.0
func (factory *Factory) GetSynchronizationMode() fdbv1beta2.SynchronizationMode
GetSynchronizationMode returns the desired fdbv1beta2.SynchronizationMode if unset, the default will be fdbv1beta2.SynchronizationModeLocal.
func (*Factory) GetUnifiedFoundationDBImage ¶
GetUnifiedFoundationDBImage returns the unified FoundationDB image provided via command line. If a registry was defined the registry will be prepended.
func (*Factory) GetUpgradeVersions ¶
func (factory *Factory) GetUpgradeVersions() []*UpgradeTestConfiguration
GetUpgradeVersions returns the upgrade versions as a string slice based on the command line flag. Each entry will be a FoundationDB version. This slice can contain duplicate entries. For upgrade tests it's expected that two versions form one test, e.g. where the odd number is the initial version and the even number is the
func (*Factory) InjectDiskFailure ¶
func (factory *Factory) InjectDiskFailure( ctx context.Context, selector chaosmesh.PodSelectorSpec, ) *ChaosMeshExperiment
InjectDiskFailure injects a disk failure for all Pods selected by the selector.
func (*Factory) InjectDiskFailureWithDuration ¶
func (factory *Factory) InjectDiskFailureWithDuration( ctx context.Context, selector chaosmesh.PodSelectorSpec, duration string, ) *ChaosMeshExperiment
InjectDiskFailureWithDuration injects a disk failure for all Pods selected by the selector for the specified duration.
func (*Factory) InjectDiskFailureWithPath ¶
func (factory *Factory) InjectDiskFailureWithPath( ctx context.Context, selector chaosmesh.PodSelectorSpec, volumePath string, path string, methods []chaosmesh.IoMethod, containers []string, ) *ChaosMeshExperiment
InjectDiskFailureWithPath injects a disk failure for all Pods selected by the selector. volumePath and path can be used to specify the affected files and methods allow to specify the affected methods.
func (*Factory) InjectDiskFailureWithPathAndDuration ¶
func (factory *Factory) InjectDiskFailureWithPathAndDuration( ctx context.Context, selector chaosmesh.PodSelectorSpec, volumePath string, path string, methods []chaosmesh.IoMethod, containers []string, duration string, ) *ChaosMeshExperiment
InjectDiskFailureWithPathAndDuration injects a disk failure for all Pods selected by the selector. volumePath and path can be used to specify the affected files and methods allow to specify the affected methods. duration will define how long the chaos is injected.
func (*Factory) InjectHTTPClientChaosWrongResultFdbMonitorConf ¶
func (factory *Factory) InjectHTTPClientChaosWrongResultFdbMonitorConf( ctx context.Context, selector chaosmesh.PodSelectorSpec, namespace string, ) *ChaosMeshExperiment
InjectHTTPClientChaosWrongResultFdbMonitorConf this method can be used to simulate a bad response from the operator to the sidecar. Currently this method returns as body the value "wrong" when the operator does a request against the check_hash/fdbmonitor.conf endpoint, e.g. during upgrades.
func (*Factory) InjectIOLatency ¶
func (factory *Factory) InjectIOLatency( ctx context.Context, selector chaosmesh.PodSelectorSpec, delay string, ) *ChaosMeshExperiment
InjectIOLatency injects IOLatency for single pod.
func (*Factory) InjectNetworkLatency ¶
func (factory *Factory) InjectNetworkLatency( ctx context.Context, source chaosmesh.PodSelectorSpec, target chaosmesh.PodSelectorSpec, direction chaosmesh.Direction, delay *chaosmesh.DelaySpec, ) *ChaosMeshExperiment
InjectNetworkLatency injects network latency between the source and the target.
func (*Factory) InjectNetworkLoss ¶
func (factory *Factory) InjectNetworkLoss( ctx context.Context, lossPercentage string, source chaosmesh.PodSelectorSpec, target chaosmesh.PodSelectorSpec, direction chaosmesh.Direction, ) *ChaosMeshExperiment
InjectNetworkLoss injects network loss between the source and the target.
func (*Factory) InjectNetworkLossBetweenPods ¶
func (factory *Factory) InjectNetworkLossBetweenPods( ctx context.Context, pods []chaosmesh.PodSelectorSpec, loss string, )
InjectNetworkLossBetweenPods Injects network loss b/w each combination of podGroups.
func (*Factory) InjectPartition ¶
func (factory *Factory) InjectPartition( ctx context.Context, selector chaosmesh.PodSelectorSpec, ) *ChaosMeshExperiment
InjectPartition injects a partition to the provided selector.
func (*Factory) InjectPartitionBetween ¶
func (factory *Factory) InjectPartitionBetween( ctx context.Context, source chaosmesh.PodSelectorSpec, target chaosmesh.PodSelectorSpec, ) *ChaosMeshExperiment
InjectPartitionBetween injects a partition between the source and the target.
func (*Factory) InjectPartitionBetweenWithDirection ¶
func (factory *Factory) InjectPartitionBetweenWithDirection( ctx context.Context, source chaosmesh.PodSelectorSpec, target chaosmesh.PodSelectorSpec, direction chaosmesh.Direction, ) *ChaosMeshExperiment
InjectPartitionBetweenWithDirection injects a partition between the source and the target for the specified direction.
func (*Factory) InjectPartitionOnSomeTargetPods ¶
func (factory *Factory) InjectPartitionOnSomeTargetPods( ctx context.Context, source chaosmesh.PodSelectorSpec, target chaosmesh.PodSelectorSpec, fixedNumber int, ) *ChaosMeshExperiment
InjectPartitionOnSomeTargetPods injects a partition on some Pods instead of all Pods. It picks a specific number of pods randomly. If the specified "fixedNumber" is greater than the number of all targets, all targets will be chosen.
func (*Factory) InjectPartitionWithExternalTargets ¶
func (factory *Factory) InjectPartitionWithExternalTargets( ctx context.Context, selector chaosmesh.PodSelectorSpec, externalTargets []string, ) *ChaosMeshExperiment
InjectPartitionWithExternalTargets injects a partition to the provided selector with the external targets
func (*Factory) InjectPodStress ¶
func (factory *Factory) InjectPodStress( ctx context.Context, target chaosmesh.PodSelectorSpec, containerNames []string, memoryStressor *chaosmesh.MemoryStressor, cpuStressor *chaosmesh.CPUStressor, ) *ChaosMeshExperiment
InjectPodStress injects pod stress on the target.
func (*Factory) MultipleNamespaces ¶
func (factory *Factory) MultipleNamespaces( ctx context.Context, config *ClusterConfig, dcIDs []string, ) []string
MultipleNamespaces creates multiple namespaces for HA testing.
func (*Factory) OperatorIsAtLeast ¶
OperatorIsAtLeast is a helper method to check is the running operator is at least in the specified version.
func (*Factory) PrependRegistry ¶
PrependRegistry if a registry was provided as flag, the registry will be prepended.
func (*Factory) RandStringRunes ¶
RandStringRunes randomly generates a string of length n.
func (*Factory) RandomPickCluster ¶
func (factory *Factory) RandomPickCluster(input []*FdbCluster, count int) []*FdbCluster
RandomPickCluster randomly picks the number of FdbCluster from the slice. If the slice contains less than count FdbCluster, all FdbCluster will be returned in a random order.
func (*Factory) RandomPickOneCluster ¶
func (factory *Factory) RandomPickOneCluster(input []*FdbCluster) *FdbCluster
RandomPickOneCluster will pick one FdbCluster randomly from the FdbCluster slice.
func (*Factory) RandomPickOnePod ¶
RandomPickOnePod will pick one Pods randomly from the Pod slice.
func (*Factory) RandomPickPod ¶
RandomPickPod randomly picks the number of Pods from the slice. If the slice contains less than count Pods, all Pods will be returned in a random order. This method will ensure that only a Pod with a non-zero deletion timestamp will be picked.
func (*Factory) RecreateOperatorPods ¶
RecreateOperatorPods will recreate all operator Pods in the specified namespace and wait until the new Pods are up and running.
func (*Factory) ScheduleInjectPodKill ¶
func (factory *Factory) ScheduleInjectPodKill( ctx context.Context, target chaosmesh.PodSelectorSpec, schedule string, mode chaosmesh.SelectorMode, ) *ChaosMeshExperiment
ScheduleInjectPodKill schedules a Pod Kill action.
func (*Factory) ScheduleInjectPodKillWithName ¶
func (factory *Factory) ScheduleInjectPodKillWithName( ctx context.Context, target chaosmesh.PodSelectorSpec, schedule string, mode chaosmesh.SelectorMode, name string, ) *ChaosMeshExperiment
ScheduleInjectPodKillWithName schedules a Pod Kill action with the specified name.
func (*Factory) SetFinalizerForPod ¶
func (factory *Factory) SetFinalizerForPod( ctx context.Context, pod *corev1.Pod, finalizers []string, )
SetFinalizerForPod will set the provided finalizer slice for the Pods
func (*Factory) Shutdown ¶
Shutdown executes all the shutdown handlers, usually called in afterSuite or afterTest depending on your scoping of the factory.
func (*Factory) SingleNamespace ¶
SingleNamespace returns a single namespace.
func (*Factory) StopInvariantCheck ¶
func (factory *Factory) StopInvariantCheck()
StopInvariantCheck will stop the current invariant checker by triggering the shutdown hook and resetting the shutdown hooks.
func (*Factory) UploadFile ¶
func (factory *Factory) UploadFile( ctx context.Context, target *corev1.Pod, container string, src io.Reader, dst string) error
UploadFile uploads a file from src into the Pod/container dst.
func (*Factory) UseUnifiedImage ¶
UseUnifiedImage returns true if the e2e tests should use the unified image.
func (*Factory) WaitUntilDataLoaderIsDone ¶
func (factory *Factory) WaitUntilDataLoaderIsDone(ctx context.Context, cluster *FdbCluster)
WaitUntilDataLoaderIsDone will wait until the data loader Job has finished.
type FactoryOptions ¶
type FactoryOptions struct {
// contains filtered or unexported fields
}
FactoryOptions defines the (command line) options that are support for the e2e test cases.
func InitFlags ¶
func InitFlags() *FactoryOptions
InitFlags sets up the custom flags for this test suite and returns the parsed FactoryOptions struct. This method will take care of including the command line flags from Ginkgo and the testing framework.
func (*FactoryOptions) BindFlags ¶
func (options *FactoryOptions) BindFlags(fs *flag.FlagSet)
BindFlags binds the FactoryOptions flags to the provided FlagSet. This can be used to extend the current test setup with custom/additional flags.
type FdbBackup ¶
type FdbBackup struct {
// contains filtered or unexported fields
}
FdbBackup represents a fdbv1beta2.FoundationDBBackup resource for doing backups of a FdbCluster.
func (*FdbBackup) ForceReconcile ¶ added in v2.23.0
ForceReconcile will add an annotation with the current timestamp on the FoundationDBBackup resource to make sure the operator reconciliation loop is triggered. This is used to speed up some test cases.
func (*FdbBackup) GetBackup ¶ added in v2.23.0
func (fdbBackup *FdbBackup) GetBackup(ctx context.Context) *fdbv1beta2.FoundationDBBackup
GetBackup fetch the current state of the fdbv1beta2.FoundationDBBackup and return it.
func (*FdbBackup) GetBackupPod ¶
GetBackupPod returns a random backup Pod for the provided backup.
func (*FdbBackup) GetBackupPods ¶
GetBackupPods returns a *corev1.PodList, which contains all pods for the provided backup.
func (*FdbBackup) RunAbortCommand ¶ added in v2.29.0
RunAbortCommand runs the abort command on a randomly chosen backup pod.
func (*FdbBackup) RunCommandOnBackupPod ¶ added in v2.27.0
RunCommandOnBackupPod runs the provided command on a randomly chosen backup pod.
func (*FdbBackup) RunDescribeCommand ¶ added in v2.22.0
func (fdbBackup *FdbBackup) RunDescribeCommand( ctx context.Context, ) *fdbv1beta2.FoundationDBBackupDescribe
RunDescribeCommand runs the describe command on a randomly chosen backup pod.
func (*FdbBackup) RunExpireCommand ¶ added in v2.31.0
func (fdbBackup *FdbBackup) RunExpireCommand( ctx context.Context, expireBeforeVersion uint64, ) string
RunExpireCommand runs the expire command on a randomly chosen backup pod.
func (*FdbBackup) RunListCommand ¶ added in v2.24.0
RunListCommand runs the list command on a randomly chosen backup pod.
func (*FdbBackup) RunStatusCommand ¶ added in v2.27.0
func (fdbBackup *FdbBackup) RunStatusCommand( ctx context.Context, ) *fdbv1beta2.FoundationDBLiveBackupStatus
RunStatusCommand runs the status command on a randomly chosen backup pod.
func (*FdbBackup) SetSnapshotInterval ¶ added in v2.27.0
SetSnapshotInterval updates the snapshot interval of the current backup.
func (*FdbBackup) UpdateBackupSpec ¶ added in v2.32.0
func (fdbBackup *FdbBackup) UpdateBackupSpec()
UpdateBackupSpec ensures that the FoundationDBBackup will be updated in Kubernetes. This method has a retry mechanism implemented and ensures that the provided (local) Spec matches the Spec in Kubernetes.
func (*FdbBackup) UpdateBackupSpecWithSpec ¶ added in v2.32.0
func (fdbBackup *FdbBackup) UpdateBackupSpecWithSpec( desiredSpec *fdbv1beta2.FoundationDBBackupSpec, )
UpdateBackupSpecWithSpec ensures that the FoundationDBBackup will be updated in Kubernetes. This method has a retry mechanism implemented and ensures that the provided (local) Spec matches the Spec in Kubernetes. You must make sure that you call backup.GetBackup() before updating the spec, to make sure you are not overwriting the current state with an outdated state. An example on how to update a field with this method:
spec := backup.GetBackup().Spec.DeepCopy() // Fetch the current Spec. spec.AgentCount = "42" // Make your changes. backup.UpdateBackupSpecWithSpec(backupSpec) // Update the spec.
func (*FdbBackup) WaitForReconciliation ¶
WaitForReconciliation waits until the FdbBackup resource is fully reconciled.
type FdbBackupConfiguration ¶ added in v2.12.0
type FdbBackupConfiguration struct {
// BackupType defines the backup type that should be used for this backup.
BackupType *fdbv1beta2.BackupType
// BackupState defines the state the backup should be started with.
BackupState *fdbv1beta2.BackupState
// EncryptionEnabled determines whether backup encryption should be used.
EncryptionEnabled bool
// BackupMode defines the backup mode that should be used.
BackupMode *fdbv1beta2.BackupMode
// CustomParameters defines the custom parameters to add to the backup deployment.
CustomParameters fdbv1beta2.FoundationDBCustomParameters
// Tag for the created backup.
Tag *fdbv1beta2.BackupTag
// BackupName is the name for the backup that should be created. If not set the default will be
// the cluster name.
BackupName *string
}
FdbBackupConfiguration can be used to configure the created fdbv1beta2.FoundationDBBackup with different options.
type FdbCluster ¶
type FdbCluster struct {
// contains filtered or unexported fields
}
FdbCluster is a fixture that allows tests to manipulate an FDB cluster with some name. Depending on how it was instantiated, the cluster may or may not exist, and may or may not be part of an HA configuration.
func (*FdbCluster) AllProcessGroupsHaveCondition ¶
func (fdbCluster *FdbCluster) AllProcessGroupsHaveCondition( ctx context.Context, condition fdbv1beta2.ProcessGroupConditionType, ignoreMissing bool, ) bool
AllProcessGroupsHaveCondition returns true if all process groups have the specified condition. If allowOtherConditions is set to true only this condition is allowed.
func (*FdbCluster) BounceClusterWithoutWait ¶
func (fdbCluster *FdbCluster) BounceClusterWithoutWait(ctx context.Context) error
BounceClusterWithoutWait will restart all fdberver processes in the current FoundationDBCluster without waiting for the cluster to become available again.
func (*FdbCluster) CheckPodIsDeleted ¶
func (fdbCluster *FdbCluster) CheckPodIsDeleted(ctx context.Context, podName string) bool
CheckPodIsDeleted return true if Pod no longer exists at the executed time point
func (*FdbCluster) ClearBuggifyNoSchedule ¶
func (fdbCluster *FdbCluster) ClearBuggifyNoSchedule( ctx context.Context, waitForReconcile bool, ) error
ClearBuggifyNoSchedule this will reset the NoSchedule setting for the current FoundationDBCluster.
func (*FdbCluster) ClearProcessGroupsToRemove ¶
func (fdbCluster *FdbCluster) ClearProcessGroupsToRemove(ctx context.Context) error
ClearProcessGroupsToRemove clears the InstancesToRemove list in the cluster spec.
func (*FdbCluster) ClearRange ¶
func (fdbCluster *FdbCluster) ClearRange(ctx context.Context, prefixBytes []byte, timeout int)
ClearRange will delete the provided range.
func (*FdbCluster) Create ¶
func (fdbCluster *FdbCluster) Create(ctx context.Context) error
Create asynchronously creates this FDB cluster.
func (*FdbCluster) CreateTesterDeployment ¶
func (fdbCluster *FdbCluster) CreateTesterDeployment( ctx context.Context, replicas int, ) *appsv1.Deployment
CreateTesterDeployment will create a deployment that runs tester processes with the specified number of replicas.
func (*FdbCluster) Destroy ¶
func (fdbCluster *FdbCluster) Destroy(ctx context.Context) error
Destroy will remove the underlying cluster.
func (*FdbCluster) DestroyWithWaitForTearDown ¶ added in v2.15.0
func (fdbCluster *FdbCluster) DestroyWithWaitForTearDown( ctx context.Context, waitForTearDown bool, ) error
DestroyWithWaitForTearDown will remove the underlying cluster and wait for the resources to be removed.
func (*FdbCluster) EnsurePodIsDeleted ¶
func (fdbCluster *FdbCluster) EnsurePodIsDeleted(ctx context.Context, podName string)
EnsurePodIsDeleted validates that a Pod is either not existing or is marked as deleted with a non-zero deletion timestamp.
func (*FdbCluster) EnsurePodIsDeletedWithCustomTimeout ¶
func (fdbCluster *FdbCluster) EnsurePodIsDeletedWithCustomTimeout( ctx context.Context, podName string, timeoutMinutes int, )
EnsurePodIsDeletedWithCustomTimeout validates that a Pod is either not existing or is marked as deleted with a non-zero deletion timestamp. It times out after timeoutMinutes.
func (*FdbCluster) EnsureTeamTrackersAreHealthy ¶
func (fdbCluster *FdbCluster) EnsureTeamTrackersAreHealthy(ctx context.Context)
EnsureTeamTrackersAreHealthy will check if the machine-readable status suggest that the team trackers are healthy and all data is present.
func (*FdbCluster) EnsureTeamTrackersHaveMinReplicas ¶
func (fdbCluster *FdbCluster) EnsureTeamTrackersHaveMinReplicas(ctx context.Context)
EnsureTeamTrackersHaveMinReplicas will check if the machine-readable status suggest that the team trackers min_replicas match the expected replicas.
func (*FdbCluster) ExecuteCmdOnPod ¶
func (fdbCluster *FdbCluster) ExecuteCmdOnPod( ctx context.Context, pod corev1.Pod, container string, command string, printOutput bool, ) (string, string, error)
ExecuteCmdOnPod will run the provided command in a Shell.
func (*FdbCluster) ForceReconcile ¶
func (fdbCluster *FdbCluster) ForceReconcile(ctx context.Context)
ForceReconcile will add an annotation with the current timestamp on the FoundationDBCluster resource to make sure the operator reconciliation loop is triggered. This is used to speed up some test cases.
func (*FdbCluster) GenerateRandomValues ¶
func (fdbCluster *FdbCluster) GenerateRandomValues( n int, prefix byte, ) []KeyValue
GenerateRandomValues will generate n random values with the provided prefix.
func (*FdbCluster) GetAllPods ¶
func (fdbCluster *FdbCluster) GetAllPods(ctx context.Context) *corev1.PodList
GetAllPods returns all pods, even if not running.
func (*FdbCluster) GetAutomationOptions ¶
func (fdbCluster *FdbCluster) GetAutomationOptions() fdbv1beta2.FoundationDBClusterAutomationOptions
GetAutomationOptions return the fdbCluster's AutomationOptions
func (*FdbCluster) GetCachedCluster ¶
func (fdbCluster *FdbCluster) GetCachedCluster() *fdbv1beta2.FoundationDBCluster
GetCachedCluster returns the current cluster definition stored in the fdbCluster struct. This could be outdated and if you need the most recent version of the definition you should use `GetCluster`. This method is useful if you want to inspect fields that are not changing.
func (*FdbCluster) GetCluster ¶
func (fdbCluster *FdbCluster) GetCluster(ctx context.Context) *fdbv1beta2.FoundationDBCluster
GetCluster returns the FoundationDBCluster of the cluster. This will fetch the latest value from the Kubernetes API.
func (*FdbCluster) GetClusterSpec ¶
func (fdbCluster *FdbCluster) GetClusterSpec( ctx context.Context, ) fdbv1beta2.FoundationDBClusterSpec
GetClusterSpec returns the current cluster spec.
func (*FdbCluster) GetClusterVersion ¶
func (fdbCluster *FdbCluster) GetClusterVersion(ctx context.Context) uint64
GetClusterVersion returns the cluster's version
func (*FdbCluster) GetCommandlineForProcessesPerClass ¶
func (fdbCluster *FdbCluster) GetCommandlineForProcessesPerClass( ctx context.Context, ) map[fdbv1beta2.ProcessClass][]string
GetCommandlineForProcessesPerClass fetches the commandline args for all processes except of the specified class.
func (*FdbCluster) GetCommandlineForProcessesPerClassWithStatus ¶ added in v2.3.0
func (fdbCluster *FdbCluster) GetCommandlineForProcessesPerClassWithStatus( status *fdbv1beta2.FoundationDBStatus, ) map[fdbv1beta2.ProcessClass][]string
GetCommandlineForProcessesPerClassWithStatus fetches the commandline args for all processes except of the specified class.
func (*FdbCluster) GetCoordinators ¶
func (fdbCluster *FdbCluster) GetCoordinators(ctx context.Context) []corev1.Pod
GetCoordinators returns the Pods of the FoundationDBCluster that are having the coordinator role.
func (*FdbCluster) GetCoordinatorsOnLogProcesses ¶ added in v2.11.0
func (fdbCluster *FdbCluster) GetCoordinatorsOnLogProcesses(ctx context.Context) []corev1.Pod
GetCoordinatorsOnLogProcesses returns the Pods of the FoundationDBCluster that have the coordinator role and have the process class log.
func (*FdbCluster) GetCustomParameters ¶
func (fdbCluster *FdbCluster) GetCustomParameters( processClass fdbv1beta2.ProcessClass, ) fdbv1beta2.FoundationDBCustomParameters
GetCustomParameters returns the current custom parameters for the specified process class.
func (*FdbCluster) GetFDBImage ¶
func (fdbCluster *FdbCluster) GetFDBImage(ctx context.Context) string
GetFDBImage return the FDB image used for the current version, defined in the FoundationDBClusterSpec.
func (*FdbCluster) GetListOfUIDsFromVolumeClaims ¶
func (fdbCluster *FdbCluster) GetListOfUIDsFromVolumeClaims( ctx context.Context, processClass fdbv1beta2.ProcessClass, ) []types.UID
GetListOfUIDsFromVolumeClaims will return of list of UIDs for the current volume claims for the provided processes class.
func (*FdbCluster) GetLogPods ¶
func (fdbCluster *FdbCluster) GetLogPods(ctx context.Context) *corev1.PodList
GetLogPods returns all Pods of this cluster that have the process class log.
func (*FdbCluster) GetLogServersPerPod ¶
func (fdbCluster *FdbCluster) GetLogServersPerPod() int
GetLogServersPerPod returns the current expected Log server per pod.
func (*FdbCluster) GetPod ¶
GetPod returns the Pod with the given name that runs in the same namespace as the FoundationDBCluster.
func (*FdbCluster) GetPodIDs ¶
func (fdbCluster *FdbCluster) GetPodIDs( ctx context.Context, processClass fdbv1beta2.ProcessClass, ) map[fdbv1beta2.ProcessGroupID]fdbv1beta2.None
GetPodIDs returns all the process group IDs for all Pods of this cluster that have the matching process class.
func (*FdbCluster) GetPodRoleMap ¶
func (fdbCluster *FdbCluster) GetPodRoleMap( ctx context.Context, ) map[fdbv1beta2.ProcessGroupID][]RoleInfo
GetPodRoleMap returns a map with the process group ID as key and all associated roles.
func (*FdbCluster) GetPodTemplateSpec ¶
func (fdbCluster *FdbCluster) GetPodTemplateSpec( processClass fdbv1beta2.ProcessClass, ) *corev1.PodSpec
GetPodTemplateSpec returns the current pod template spec for the specified process class.
func (*FdbCluster) GetPods ¶
func (fdbCluster *FdbCluster) GetPods(ctx context.Context) *corev1.PodList
GetPods returns only running Pods.
func (*FdbCluster) GetPodsNames ¶
func (fdbCluster *FdbCluster) GetPodsNames(ctx context.Context) []string
GetPodsNames GetS all Running Pods and return their names.
func (*FdbCluster) GetPodsWithRole ¶
func (fdbCluster *FdbCluster) GetPodsWithRole( ctx context.Context, role fdbv1beta2.ProcessRole, ) []corev1.Pod
GetPodsWithRole returns all Pods that have the provided role.
func (*FdbCluster) GetProcessCount ¶
func (fdbCluster *FdbCluster) GetProcessCount( ctx context.Context, targetRole fdbv1beta2.ProcessRole, ) int
GetProcessCount returns the number of processes having the specified role
func (*FdbCluster) GetProcessCountByProcessClass ¶
func (fdbCluster *FdbCluster) GetProcessCountByProcessClass( ctx context.Context, pClass fdbv1beta2.ProcessClass, ) int
GetProcessCountByProcessClass returns the number of processes based on process class
func (*FdbCluster) GetProcessCounts ¶
func (fdbCluster *FdbCluster) GetProcessCounts() (fdbv1beta2.ProcessCounts, error)
GetProcessCounts returns the process counts of the current FoundationDBCluster.
func (*FdbCluster) GetProcessSettings ¶ added in v2.11.0
func (fdbCluster *FdbCluster) GetProcessSettings( processClass fdbv1beta2.ProcessClass, ) *fdbv1beta2.ProcessSettings
GetProcessSettings returns the process settings for the process class. If no settings are defined for the specific process class the process settings for the general class will be returned.
func (*FdbCluster) GetRange ¶
func (fdbCluster *FdbCluster) GetRange( ctx context.Context, prefixBytes []byte, limit int, timeout int, ) (keyValues []KeyValue)
GetRange will return the values of the provided range.
func (*FdbCluster) GetResourceLabels ¶
func (fdbCluster *FdbCluster) GetResourceLabels() map[string]string
GetResourceLabels returns the resource labels for all created resources of the current FoundationDBCluster.
func (*FdbCluster) GetServices ¶
func (fdbCluster *FdbCluster) GetServices(ctx context.Context) *corev1.ServiceList
GetServices returns the services associated with the current FoundationDBCluster.
func (*FdbCluster) GetSidecarImageForVersion ¶
func (fdbCluster *FdbCluster) GetSidecarImageForVersion( ctx context.Context, version string, ) string
GetSidecarImageForVersion return the sidecar image used for the specified version.
func (*FdbCluster) GetStatelessPods ¶
func (fdbCluster *FdbCluster) GetStatelessPods(ctx context.Context) *corev1.PodList
GetStatelessPods returns all Pods of this cluster that have the process class stateless.
func (*FdbCluster) GetStatus ¶
func (fdbCluster *FdbCluster) GetStatus(ctx context.Context) *fdbv1beta2.FoundationDBStatus
GetStatus returns fdb status queried from a random operator Pod in this clusters namespace.
func (*FdbCluster) GetStoragePods ¶
func (fdbCluster *FdbCluster) GetStoragePods(ctx context.Context) *corev1.PodList
GetStoragePods returns all Pods of this cluster that have the process class storage.
func (*FdbCluster) GetStorageServerPerPod ¶
func (fdbCluster *FdbCluster) GetStorageServerPerPod() int
GetStorageServerPerPod returns the current expected storage server per pod.
func (*FdbCluster) GetVolumeClaimsForProcesses ¶
func (fdbCluster *FdbCluster) GetVolumeClaimsForProcesses( ctx context.Context, processClass fdbv1beta2.ProcessClass, ) *corev1.PersistentVolumeClaimList
GetVolumeClaimsForProcesses returns a list of volume claims belonging to this cluster and the specific process class.
func (*FdbCluster) GetVolumeSize ¶
func (fdbCluster *FdbCluster) GetVolumeSize( processClass fdbv1beta2.ProcessClass, ) resource.Quantity
GetVolumeSize returns the volume size for the specified process class.
func (*FdbCluster) HasHeadlessService ¶
func (fdbCluster *FdbCluster) HasHeadlessService() bool
HasHeadlessService returns true if the cluster has a headless service.
func (*FdbCluster) HasTLSEnabled ¶
func (fdbCluster *FdbCluster) HasTLSEnabled(ctx context.Context) bool
HasTLSEnabled returns true if the cluster is running with TLS enabled.
func (*FdbCluster) InvariantClusterStatusAvailable ¶
func (fdbCluster *FdbCluster) InvariantClusterStatusAvailable() error
InvariantClusterStatusAvailable checks if the cluster is available the whole test with the default unavailable threshold.
func (*FdbCluster) InvariantClusterStatusAvailableWithThreshold ¶
func (fdbCluster *FdbCluster) InvariantClusterStatusAvailableWithThreshold( availabilityThreshold time.Duration, ) error
InvariantClusterStatusAvailableWithThreshold checks if the database is at a maximum unavailable for the provided threshold.
func (*FdbCluster) IsAvailable ¶
func (fdbCluster *FdbCluster) IsAvailable(ctx context.Context) bool
IsAvailable returns true if the database is available.
func (*FdbCluster) Name ¶
func (fdbCluster *FdbCluster) Name() string
Name returns the name for the FoundationDBCluster.
func (*FdbCluster) Namespace ¶
func (fdbCluster *FdbCluster) Namespace() string
Namespace returns the namespace for the FoundationDBCluster.
func (*FdbCluster) ReplacePod ¶
func (fdbCluster *FdbCluster) ReplacePod( ctx context.Context, pod corev1.Pod, waitForReconcile bool, )
ReplacePod replaces the provided Pod if it's part of the FoundationDBCluster.
func (*FdbCluster) ReplacePods ¶
func (fdbCluster *FdbCluster) ReplacePods( ctx context.Context, pods []corev1.Pod, waitForReconcile bool, )
ReplacePods replaces the provided Pods in the current FoundationDBCluster.
func (*FdbCluster) RunFdbBackupCommandInOperatorWithoutRetry ¶ added in v2.12.0
func (fdbCluster *FdbCluster) RunFdbBackupCommandInOperatorWithoutRetry( ctx context.Context, command string, printOutput bool, ) (string, string, error)
RunFdbBackupCommandInOperatorWithoutRetry allows to run a command with fdbbackup in the operator Pod without doing any retries.
func (*FdbCluster) RunFdbCliCommandInOperator ¶
func (fdbCluster *FdbCluster) RunFdbCliCommandInOperator( ctx context.Context, command string, printOutput bool, timeout int, ) (string, string)
RunFdbCliCommandInOperator allows to run a command with fdbcli in the operator Pod.
func (*FdbCluster) RunFdbCliCommandInOperatorWithoutRetry ¶
func (fdbCluster *FdbCluster) RunFdbCliCommandInOperatorWithoutRetry( ctx context.Context, command string, printOutput bool, timeout int, ) (string, string, error)
RunFdbCliCommandInOperatorWithoutRetry allows to run a command with fdbcli in the operator Pod without doing any retries.
func (*FdbCluster) SetAutoReplacements ¶
func (fdbCluster *FdbCluster) SetAutoReplacements( ctx context.Context, enabled bool, detectionTime time.Duration, ) error
SetAutoReplacements will enabled or disable the auto replacement feature and allows to specify the detection time for a replacement.
func (*FdbCluster) SetAutoReplacementsWithWait ¶
func (fdbCluster *FdbCluster) SetAutoReplacementsWithWait( ctx context.Context, enabled bool, detectionTime time.Duration, wait bool, ) error
SetAutoReplacementsWithWait set the auto replacement setting on the operator and only waits for the cluster to reconcile if wait is set to true.
func (*FdbCluster) SetBuggifyBlockRemoval ¶
func (fdbCluster *FdbCluster) SetBuggifyBlockRemoval( ctx context.Context, blockRemovals []fdbv1beta2.ProcessGroupID, )
SetBuggifyBlockRemoval will set the provided list of process group IDs to be blocked for removal.
func (*FdbCluster) SetClusterTaintConfig ¶
func (fdbCluster *FdbCluster) SetClusterTaintConfig( ctx context.Context, taintOption []fdbv1beta2.TaintReplacementOption, taintReplacementTimeSeconds *int, )
SetClusterTaintConfig set fdbCluster's TaintReplacementOptions
func (*FdbCluster) SetCrashLoopContainers ¶
func (fdbCluster *FdbCluster) SetCrashLoopContainers( ctx context.Context, crashLoopContainers []fdbv1beta2.CrashLoopContainerObject, waitForReconcile bool, )
SetCrashLoopContainers sets the crashLoopContainers of the FoundationDBCluster spec.
func (*FdbCluster) SetCustomParameters ¶
func (fdbCluster *FdbCluster) SetCustomParameters( ctx context.Context, customParameters map[fdbv1beta2.ProcessClass]fdbv1beta2.FoundationDBCustomParameters, waitForReconcile bool, ) error
SetCustomParameters allows to set the custom parameters of the provided process class.
func (*FdbCluster) SetDatabaseConfiguration ¶
func (fdbCluster *FdbCluster) SetDatabaseConfiguration( ctx context.Context, config fdbv1beta2.DatabaseConfiguration, waitForReconcile bool, ) error
SetDatabaseConfiguration sets the provided DatabaseConfiguration for the FoundationDBCluster.
func (*FdbCluster) SetFinalizerForPvc ¶
func (fdbCluster *FdbCluster) SetFinalizerForPvc( ctx context.Context, finalizers []string, pvc corev1.PersistentVolumeClaim, ) error
SetFinalizerForPvc allows to set the finalizers for the provided PVC.
func (*FdbCluster) SetIgnoreDuringRestart ¶
func (fdbCluster *FdbCluster) SetIgnoreDuringRestart( ctx context.Context, processes []fdbv1beta2.ProcessGroupID, )
SetIgnoreDuringRestart sets the buggify option for the operator.
func (*FdbCluster) SetIgnoreMissingProcessesSeconds ¶
func (fdbCluster *FdbCluster) SetIgnoreMissingProcessesSeconds( ctx context.Context, duration time.Duration, )
SetIgnoreMissingProcessesSeconds sets the IgnoreMissingProcessesSeconds setting.
func (*FdbCluster) SetKillProcesses ¶
func (fdbCluster *FdbCluster) SetKillProcesses(ctx context.Context, allowKill bool, wait bool)
SetKillProcesses sets the automation option to allow the operator to restart processes or not.
func (*FdbCluster) SetLogServersPerPod ¶
func (fdbCluster *FdbCluster) SetLogServersPerPod( ctx context.Context, serverPerPod int, waitForReconcile bool, ) error
SetLogServersPerPod set the LogServersPerPod field in the cluster spec.
func (*FdbCluster) SetPodAsUnschedulable ¶
func (fdbCluster *FdbCluster) SetPodAsUnschedulable(ctx context.Context, pod corev1.Pod)
SetPodAsUnschedulable sets the provided Pod on the NoSchedule list of the current FoundationDBCluster. This will make sure that the Pod is stuck in Pending.
func (*FdbCluster) SetPodTemplateSpec ¶
func (fdbCluster *FdbCluster) SetPodTemplateSpec( ctx context.Context, processClass fdbv1beta2.ProcessClass, podTemplateSpec *corev1.PodSpec, waitForReconcile bool, ) error
SetPodTemplateSpec allows to set the pod template spec of the provided process class.
func (*FdbCluster) SetProcessGroupPrefix ¶
func (fdbCluster *FdbCluster) SetProcessGroupPrefix(ctx context.Context, prefix string) error
SetProcessGroupPrefix will set the process group prefix setting.
func (*FdbCluster) SetProcessGroupsAsUnschedulable ¶
func (fdbCluster *FdbCluster) SetProcessGroupsAsUnschedulable( ctx context.Context, processGroups []fdbv1beta2.ProcessGroupID, )
SetProcessGroupsAsUnschedulable sets the provided process groups on the NoSchedule list of the current FoundationDBCluster. This will make sure that the Pod is stuck in Pending.
func (*FdbCluster) SetPublicIPSource ¶
func (fdbCluster *FdbCluster) SetPublicIPSource( ctx context.Context, publicIPSource fdbv1beta2.PublicIPSource, ) error
SetPublicIPSource will set the public IP source of the current FoundationDBCluster to the provided IP source.
func (*FdbCluster) SetSkipReconciliation ¶
func (fdbCluster *FdbCluster) SetSkipReconciliation(ctx context.Context, skip bool)
SetSkipReconciliation will set the skip setting for the current FoundationDBCluster. This setting will make sure that the operator is not taking any actions on this cluster.
func (*FdbCluster) SetStorageServerPerPod ¶
func (fdbCluster *FdbCluster) SetStorageServerPerPod(ctx context.Context, serverPerPod int) error
SetStorageServerPerPod set the SetStorageServerPerPod field in the cluster spec.
func (*FdbCluster) SetTLS ¶
func (fdbCluster *FdbCluster) SetTLS( ctx context.Context, enableMainContainerTLS bool, enableSidecarContainerTLS bool, ) error
SetTLS will enabled or disable the TLS setting in the current FoundationDBCluster.
func (*FdbCluster) SetUseDNSInClusterFile ¶
func (fdbCluster *FdbCluster) SetUseDNSInClusterFile( ctx context.Context, useDNSInClusterFile bool, ) error
SetUseDNSInClusterFile enables DNS in the cluster file. Enable this setting to use DNS instead of IP addresses in the connection string.
func (*FdbCluster) SetVolumeSize ¶
func (fdbCluster *FdbCluster) SetVolumeSize( ctx context.Context, processClass fdbv1beta2.ProcessClass, size resource.Quantity, ) error
SetVolumeSize updates the volume size for the specified process class.
func (*FdbCluster) StatusInvariantChecker ¶
func (fdbCluster *FdbCluster) StatusInvariantChecker( name string, threshold time.Duration, f func(status *fdbv1beta2.FoundationDBStatus) error, ) error
StatusInvariantChecker provides a way to check an invariant for the cluster status. nolint:nilerr
func (*FdbCluster) Update ¶
func (fdbCluster *FdbCluster) Update(ctx context.Context) error
Update asynchronously updates this FDB cluster definition.
func (*FdbCluster) UpdateAnnotationsAndLabels ¶
func (fdbCluster *FdbCluster) UpdateAnnotationsAndLabels( ctx context.Context, annotations map[string]string, labels map[string]string, )
UpdateAnnotationsAndLabels will update the annotations and labels to the provided values. Example usage:
annotations := fdbCluster.GetCachedCluster().GetAnnotations()
if annotations == nil {
annotations = map[string]string{}
}
annotations["foundationdb.org/testing"] = "awesome"
labels := fdbCluster.GetCachedCluster().GetLabels()
fdbCluster.UpdateAnnotationsAndLabels(annotations, labels)
func (*FdbCluster) UpdateClusterSpec ¶
func (fdbCluster *FdbCluster) UpdateClusterSpec(ctx context.Context)
UpdateClusterSpec ensures that the FoundationDBCluster will be updated in Kubernetes. This method has a retry mechanism implemented and ensures that the provided (local) Spec matches the Spec in Kubernetes.
func (*FdbCluster) UpdateClusterSpecWithSpec ¶
func (fdbCluster *FdbCluster) UpdateClusterSpecWithSpec( ctx context.Context, desiredSpec *fdbv1beta2.FoundationDBClusterSpec, )
UpdateClusterSpecWithSpec ensures that the FoundationDBCluster will be updated in Kubernetes. This method has a retry mechanism implemented and ensures that the provided (local) Spec matches the Spec in Kubernetes. You must make sure that you call fdbCluster.GetCluster() before updating the spec, to make sure you are not overwriting the current state with an outdated state. An example on how to update a field with this method:
spec := fdbCluster.GetCluster().Spec.DeepCopy() // Fetch the current Spec. spec.Version = "7.1.27" // Make your changes. fdbCluster.UpdateClusterSpecWithSpec(spec) // Update the spec.
func (*FdbCluster) UpdateClusterStatus ¶
func (fdbCluster *FdbCluster) UpdateClusterStatus(ctx context.Context)
UpdateClusterStatus updates the FoundationDBCluster status. This method allows to modify the status sub-resource of the FoundationDBCluster resource.
func (*FdbCluster) UpdateClusterStatusWithStatus ¶
func (fdbCluster *FdbCluster) UpdateClusterStatusWithStatus( ctx context.Context, desiredStatus *fdbv1beta2.FoundationDBClusterStatus, )
UpdateClusterStatusWithStatus ensures that the FoundationDBCluster status will be updated in Kubernetes. This method has a retry mechanism implemented and ensures that the provided (local) Status matches the status in Kubernetes. You must make sure that you call fdbCluster.GetCluster() before updating the status, to make sure you are not overwriting the current state with an outdated state. An example on how to update a field with this method:
// Make sure the operator doesn't modify the status.
fdbCluster.SetSkipReconciliation(true)
status := fdbCluster.GetCluster().Status.DeepCopy() // Fetch the current status.
// Create a new process group.
processGroupID = cluster.GetNextRandomProcessGroupID(fdbv1beta2.ProcessClassStateless, processGroupIDs[fdbv1beta2.ProcessClassStateless])
status.ProcessGroups = append(status.ProcessGroups, fdbv1beta2.NewProcessGroupStatus(processGroupID, fdbv1beta2.ProcessClassStateless, nil))
fdbCluster.UpdateClusterStatusWithStatus(status)
// Make sure the operator picks up the work again
fdbCluster.SetSkipReconciliation(false)
func (*FdbCluster) UpdateConnectionString ¶
func (fdbCluster *FdbCluster) UpdateConnectionString(ctx context.Context, connectionString string)
UpdateConnectionString will update the connection string in the ConfigMap and the SeedConnectionString of the custer.
func (*FdbCluster) UpdateContainerImage ¶
func (fdbCluster *FdbCluster) UpdateContainerImage( ctx context.Context, pod *corev1.Pod, containerName string, image string, )
UpdateContainerImage sets the image for the provided Pod for the provided container.
func (*FdbCluster) UpdateCoordinatorSelection ¶
func (fdbCluster *FdbCluster) UpdateCoordinatorSelection( ctx context.Context, setting []fdbv1beta2.CoordinatorSelectionSetting, ) error
UpdateCoordinatorSelection allows to update the coordinator selection for the current FoundationDBCluster.
func (*FdbCluster) UpdateLogProcessCount ¶
func (fdbCluster *FdbCluster) UpdateLogProcessCount( ctx context.Context, newLogProcessCount int, ) error
UpdateLogProcessCount updates the log process count in the cluster spec.
func (*FdbCluster) UpdateNode ¶
func (fdbCluster *FdbCluster) UpdateNode(ctx context.Context, node *corev1.Node)
UpdateNode update node definition
func (*FdbCluster) UpdateStorageClass ¶
func (fdbCluster *FdbCluster) UpdateStorageClass( ctx context.Context, storageClass string, processClass fdbv1beta2.ProcessClass, ) error
UpdateStorageClass this will set the StorageClass for the provided process class of the current FoundationDBCluster.
func (*FdbCluster) UpgradeAndVerify ¶
func (fdbCluster *FdbCluster) UpgradeAndVerify(ctx context.Context, version string)
UpgradeAndVerify will upgrade the cluster to the new version and perform a check at the end that the running version matched the new version.
func (*FdbCluster) UpgradeCluster ¶
func (fdbCluster *FdbCluster) UpgradeCluster( ctx context.Context, version string, waitForReconciliation bool, ) error
UpgradeCluster will upgrade the cluster to the specified version. If waitForReconciliation is set to true this method will block until the cluster is fully upgraded and all Pods are running the new image version.
func (*FdbCluster) ValidateProcessesCount ¶
func (fdbCluster *FdbCluster) ValidateProcessesCount( ctx context.Context, processClass fdbv1beta2.ProcessClass, countProcessGroups int, countServer int, )
ValidateProcessesCount will make sure that the cluster has the expected count of ProcessGroups and processes running with the provided ProcessClass.
func (*FdbCluster) VerifyVersion ¶
func (fdbCluster *FdbCluster) VerifyVersion(ctx context.Context, version string)
VerifyVersion Checks if cluster is running at the expectedVersion. This is done by checking the status of the FoundationDBCluster status. Before that we checked the cluster status json by checking the reported version of all processes. This approach only worked for version compatible upgrades, since incompatible processes won't be part of the cluster anyway. To simplify the check we verify the reported running version from the operator.
func (*FdbCluster) WaitForPodRemoval ¶
func (fdbCluster *FdbCluster) WaitForPodRemoval(ctx context.Context, pod *corev1.Pod)
WaitForPodRemoval will wait until the specified Pod is deleted.
func (*FdbCluster) WaitForReconciliation ¶
func (fdbCluster *FdbCluster) WaitForReconciliation( ctx context.Context, options ...func(*ReconciliationOptions), ) error
WaitForReconciliation waits for the cluster to be reconciled based on the provided options.
func (*FdbCluster) WaitUntilAvailable ¶
func (fdbCluster *FdbCluster) WaitUntilAvailable(ctx context.Context)
WaitUntilAvailable waits until the cluster is available.
func (*FdbCluster) WaitUntilExists ¶
func (fdbCluster *FdbCluster) WaitUntilExists(ctx context.Context)
WaitUntilExists synchronously waits until the cluster exists. Usually called after Create().
func (*FdbCluster) WaitUntilWithForceReconcile ¶
func (fdbCluster *FdbCluster) WaitUntilWithForceReconcile( ctx context.Context, pollTimeInSeconds int, timeOutInSeconds int, checkMethod func(cluster *fdbv1beta2.FoundationDBCluster) bool, ) error
WaitUntilWithForceReconcile will wait either until the checkMethod returns true or until the timeout is hit.
func (*FdbCluster) WriteKeyValue ¶
func (fdbCluster *FdbCluster) WriteKeyValue( ctx context.Context, keyValue KeyValue, timeout int, )
WriteKeyValue writes a single key value pair into FDB.
func (*FdbCluster) WriteKeyValues ¶
func (fdbCluster *FdbCluster) WriteKeyValues(ctx context.Context, keyValues []KeyValue)
WriteKeyValues writes multiples key values into FDB.
func (*FdbCluster) WriteKeyValuesWithTimeout ¶
func (fdbCluster *FdbCluster) WriteKeyValuesWithTimeout( ctx context.Context, keyValues []KeyValue, timeout int, )
WriteKeyValuesWithTimeout writes multiples key values into FDB with the specified timeout.
type FdbRestore ¶ added in v2.14.0
type FdbRestore struct {
// contains filtered or unexported fields
}
FdbRestore represents a fdbv1beta2.FoundationDBRestore resource for doing restores to a FdbCluster.
func (*FdbRestore) Destroy ¶ added in v2.14.0
func (restore *FdbRestore) Destroy(ctx context.Context)
Destroy will delete the FoundationDBRestore for the associated FdbBackup if it exists.
type HaFdbCluster ¶
type HaFdbCluster struct {
// contains filtered or unexported fields
}
HaFdbCluster is a struct around handling HA FoundationDBClusters.
func (*HaFdbCluster) Delete ¶
func (haFDBCluster *HaFdbCluster) Delete(ctx context.Context)
Delete removes all Clusters associated FoundationDBClusters.
func (*HaFdbCluster) DumpState ¶
func (haFDBCluster *HaFdbCluster) DumpState(ctx context.Context)
DumpState logs the current state of all FoundationDBClusters.
func (*HaFdbCluster) GetAllClusters ¶
func (haFDBCluster *HaFdbCluster) GetAllClusters() []*FdbCluster
GetAllClusters Returns all FoundationDBClusters that span this HA cluster.
func (*HaFdbCluster) GetCluster ¶
func (haFDBCluster *HaFdbCluster) GetCluster(suffix string) *FdbCluster
GetCluster returns the FoundationDBCluster with the provided suffix.
func (*HaFdbCluster) GetNamespaceSelector ¶
func (haFDBCluster *HaFdbCluster) GetNamespaceSelector() chaosmesh.PodSelectorSpec
GetNamespaceSelector returns the chaos mesh selector for this FDB HA cluster and all associated Pods.
func (*HaFdbCluster) GetNamespaces ¶
func (haFDBCluster *HaFdbCluster) GetNamespaces() []string
GetNamespaces returns the namespaces where all FoundationDBClusters are running in.
func (*HaFdbCluster) GetPrimary ¶
func (haFDBCluster *HaFdbCluster) GetPrimary() *FdbCluster
GetPrimary returns the FoundationDBCluster matching the suffix from PrimaryID.
func (*HaFdbCluster) GetPrimarySatellite ¶
func (haFDBCluster *HaFdbCluster) GetPrimarySatellite() *FdbCluster
GetPrimarySatellite returns the FoundationDBCluster matching the suffix from PrimarySatelliteID. This function is only valid for HA clusters using 2 satellites.
func (*HaFdbCluster) GetRemote ¶
func (haFDBCluster *HaFdbCluster) GetRemote() *FdbCluster
GetRemote returns the FoundationDBCluster matching the suffix from RemoteID.
func (*HaFdbCluster) GetRemoteSatellite ¶
func (haFDBCluster *HaFdbCluster) GetRemoteSatellite() *FdbCluster
GetRemoteSatellite returns the FoundationDBCluster matching the suffix from RemoteSatelliteID. This function is only valid for HA clusters using 2 satellites.
func (*HaFdbCluster) GetSatellite ¶
func (haFDBCluster *HaFdbCluster) GetSatellite() *FdbCluster
GetSatellite this is only for threeZoneDoubleSat config, where `satellite` is primary satellite for both regions.
func (*HaFdbCluster) SetCustomParameters ¶
func (haFDBCluster *HaFdbCluster) SetCustomParameters( ctx context.Context, customParameters map[fdbv1beta2.ProcessClass]fdbv1beta2.FoundationDBCustomParameters, waitForReconcile bool, ) error
SetCustomParameters sets the custom parameters for the provided process class.
func (*HaFdbCluster) SetDatabaseConfiguration ¶
func (haFDBCluster *HaFdbCluster) SetDatabaseConfiguration( ctx context.Context, config fdbv1beta2.DatabaseConfiguration, )
SetDatabaseConfiguration sets the new DatabaseConfiguration, without waiting for reconciliation.
func (*HaFdbCluster) UpgradeCluster ¶
func (haFDBCluster *HaFdbCluster) UpgradeCluster( ctx context.Context, version string, waitForReconciliation bool, ) error
UpgradeCluster upgrades the HA FoundationDBCluster to the specified version.
func (*HaFdbCluster) UpgradeClusterWithTimeout ¶
func (haFDBCluster *HaFdbCluster) UpgradeClusterWithTimeout( ctx context.Context, version string, waitForReconciliation bool, timeout int, ) error
UpgradeClusterWithTimeout upgrades the HA FoundationDBCluster to the specified version with the provided timeout.
func (*HaFdbCluster) VerifyVersion ¶
func (haFDBCluster *HaFdbCluster) VerifyVersion(ctx context.Context, version string)
VerifyVersion Checks if cluster is running at the expectedVersion. This is done by checking the status of the FoundationDBCluster status. Before that we checked the cluster status json by checking the reported version of all processes. This approach only worked for version compatible upgrades, since incompatible processes won't be part of the cluster anyway. To simplify the check we verify the reported running version from the operator.
func (*HaFdbCluster) WaitForReconciliation ¶
func (haFDBCluster *HaFdbCluster) WaitForReconciliation( ctx context.Context, options ...func(*ReconciliationOptions), ) error
WaitForReconciliation waits for all associated FoundationDBClusters to be reconciled
type HaMode ¶
type HaMode int
HaMode represents the targeted HA mode for the created cluster.
const ( // HaModeNone refers to a single namespace without HA. HaModeNone HaMode = iota // HaFourZoneSingleSat refers to a cluster running in 4 namespaces and the DB config has only one satellite. HaFourZoneSingleSat // HaFourZoneDoubleSat refers to a cluster running in 4 namespaces and the DB config has two satellites. HaFourZoneDoubleSat // HaThreeZoneDoubleSat refers to a cluster running in 3 namespaces and the DB config has two satellites (triplet configuration). HaThreeZoneDoubleSat // HaFourZoneDoubleSatRF4 same as HaFourZoneDoubleSat but with the RedundancyModeDouble. HaFourZoneDoubleSatRF4 )
type KeyValue ¶
KeyValue represents a key and value that can be stored in FDB.
type ReconciliationOption ¶
type ReconciliationOption func(*ReconciliationOptions)
ReconciliationOption defines the reconciliation option.
func CreationTrackerLoggerOption ¶
func CreationTrackerLoggerOption(creationTrackerLogger CreationTrackerLogger) ReconciliationOption
CreationTrackerLoggerOption sets the creation tracker that will printout the time for the different creation stages.
func MinimumGenerationOption ¶
func MinimumGenerationOption(minimumGeneration int64) ReconciliationOption
MinimumGenerationOption specifies the minimum generation to be reconciled too.
func PollTimeInSecondsOption ¶
func PollTimeInSecondsOption(pollTimeInSeconds int) ReconciliationOption
PollTimeInSecondsOption defines the polling time for the reconciliation. If not set the default is 10 seconds
func SoftReconcileOption ¶
func SoftReconcileOption(enable bool) ReconciliationOption
SoftReconcileOption specifies that the reconciliation is completed as soon as the Status.Generations.Reconciled reaches the expected generation. Independent of other possible generations, e.g. it could be still the case that the operator has to delete additional Process Groups.
func TimeOutInSecondsOption ¶
func TimeOutInSecondsOption(timeOutInSeconds int) ReconciliationOption
TimeOutInSecondsOption defines the timeout for the reconciliation. If not set the default is 4800 seconds
type ReconciliationOptions ¶
type ReconciliationOptions struct {
// contains filtered or unexported fields
}
ReconciliationOptions defines the different reconciliation options.
func MakeReconciliationOptionsStruct ¶
func MakeReconciliationOptionsStruct( options ...func(*ReconciliationOptions), ) *ReconciliationOptions
MakeReconciliationOptionsStruct applies the provided options to the ReconciliationOptions.
type ShutdownHooks ¶
type ShutdownHooks struct {
// contains filtered or unexported fields
}
ShutdownHooks allows fixtures to register a handler to be run at exit. Handlers run regardless of any preceding errors, and run in reverse order of registration.
func (*ShutdownHooks) Defer ¶
func (shutdown *ShutdownHooks) Defer(f func() error)
Defer execution of func until after the test completes.
func (*ShutdownHooks) InvokeShutdownHandlers ¶
func (shutdown *ShutdownHooks) InvokeShutdownHandlers()
InvokeShutdownHandlers in reverse order of registration.
type SidecarConfig ¶
type SidecarConfig struct {
// Image the image reference with the tag.
Image string
// FDBVersion represents the FoundationDB version for this config.
FDBVersion fdbv1beta2.Version
// ImagePullPolicy represents the pull policy for the sidecar.
ImagePullPolicy corev1.PullPolicy
// CopyAsPrimary if true the version should be copied as primary library.
CopyAsPrimary bool
}
SidecarConfig represents the configuration for a sidecar. This can be used for templating.
type UpgradeTestConfiguration ¶
type UpgradeTestConfiguration struct {
// InitialVersion represents the version before the upgrade.
InitialVersion fdbv1beta2.Version
// TargetVersion represents the version to upgrade to.
TargetVersion fdbv1beta2.Version
}
UpgradeTestConfiguration represents the configuration for an upgrade test. This includes the initial FoundationDB version and the target FoundationDB version to upgrade or downgrade the cluster to.
Source Files
¶
- blobstore.go
- certificate_generator.go
- chaos_common.go
- chaos_disk.go
- chaos_http.go
- chaos_network.go
- chaos_pod.go
- chaos_stress.go
- cluster_config.go
- factory.go
- fdb_backup.go
- fdb_cluster.go
- fdb_cluster_creation_tracker.go
- fdb_cluster_specs.go
- fdb_data_loader.go
- fdb_operator_client.go
- fdb_operator_fixtures.go
- fdb_restore.go
- fixtures.go
- ha_fdb_cluster.go
- images.go
- kubernetes_fixtures.go
- options.go
- pods.go
- random_string.go
- singleton.go
- status.go
- test_runner.go
- upgrade_test_configuration.go
- versions.go