Skip to content

Commit

Permalink
Make the conditions uniform across database opsRequests (#1052)
Browse files Browse the repository at this point in the history
Signed-off-by: Arnob Kumar Saha <arnob@appscode.com>
  • Loading branch information
ArnobKumarSaha authored Aug 7, 2023
1 parent eb1b7f2 commit eda8efd
Show file tree
Hide file tree
Showing 2 changed files with 235 additions and 231 deletions.
268 changes: 235 additions & 33 deletions apis/ops/v1alpha1/constant.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,38 +21,240 @@ const (

LabelOpsRequestKind = GenericKey + "/kind"
LabelOpsRequestName = GenericKey + "/name"
)

const (
Running = "Running"
Successful = "Successful"
Failed = "Failed"
)

// Database
const (
DatabaseReady = "DatabaseReady"
PauseDatabase = "PauseDatabase"
DatabasePauseSucceeded = "DatabasePauseSucceeded"
DatabasePauseFailed = "DatabasePauseFailed"
ResumeDatabase = "ResumeDatabase"
DatabaseResumeSucceeded = "DatabaseResumeSucceeded"
DatabaseResumeFailed = "DatabaseResumeFailed"
UpdateDatabase = "UpdateDatabase"
)

// Version Update
const (
VersionUpdate = "VersionUpdate"
VersionUpdateStarted = "VersionUpdateStarted"
VersionUpdateSucceeded = "VersionUpdateSucceeded"
VersionUpdateFailed = "VersionUpdateFailed"
)

// Horizontal
const (
HorizontalScale = "HorizontalScale"
HorizontalScaleUp = "HorizontalScaleUp"
HorizontalScaleDown = "HorizontalScaleDown"
HorizontalScaleStarted = "HorizontalScaleStarted"
HorizontalScaleSucceeded = "HorizontalScaleSucceeded"
HorizontalScaleFailed = "HorizontalScaleFailed"
)

// Vertical
const (
VerticalScale = "VerticalScale"
VerticalScaleUp = "VerticalScaleUp"
VerticalScaleDown = "VerticalScaleDown"
VerticalScaleStarted = "VerticalScaleStarted"
VerticalScaleSucceeded = "VerticalScaleSucceeded"
VerticalScaleFailed = "VerticalScaleFailed"
)

// Volume Expansion
const (
VolumeExpansion = "VolumeExpansion"
VolumeExpansionSucceeded = "VolumeExpansionSucceeded"
VolumeExpansionFailed = "VolumeExpansionFailed"
)

// Reconfigure
const (
Reconfigure = "Reconfigure"
ReconfigureSucceeded = "ReconfigureSucceeded"
ReconfigureFailed = "ReconfigureFailed"
)

// ReconfigureTLS
const (
ReconfigureTLS = "ReconfigureTLS"
ReconfigureTLSSucceeded = "ReconfigureTLSSucceeded"
ReconfigureTLSFailed = "ReconfigureTLSFailed"

RemoveTLS = "RemoveTLS"
RemoveTLSSucceeded = "RemoveTLSSucceeded"
RemoveTLSFailed = "RemoveTLSFailed"
AddTLS = "AddTLS"
AddTLSSucceeded = "AddTLSSucceeded"
AddTLSFailed = "AddTLSFailed"
Issuing = "Issuing"
IssueCertificatesSucceeded = "IssueCertificatesSucceeded"
CertificateSynced = "CertificateSynced"
IssueCertificatesFailed = "IssueCertificatesFailed"
)

// Restart
const (
Restart = "Restart"
RestartNodes = "RestartNodes"
RestartPods = "RestartPods"
RestartPodsSucceeded = "RestartPodsSucceeded"
RestartPodsFailed = "RestartPodsFailed"
)

// StatefulSets
const (
UpdateStatefulSets = "UpdateStatefulSets"
UpdateStatefulSetsSucceeded = "UpdateStatefulSetsSucceeded"
UpdateStatefulSetsFailed = "UpdateStatefulSetsFailed"
ReadyStatefulSets = "ReadyStatefulSets"
DeleteStatefulSets = "DeleteStatefulSets"
)

// Stash
const (
PauseBackupConfiguration = "PauseBackupConfiguration"
ResumeBackupConfiguration = "ResumeBackupConfiguration"
)

// ********************************** Database Specifics ************************************

// Elasticsearch Constant
const (
OrphanStatefulSetPods = "OrphanStatefulSetPods"
PrepareCustomConfig = "PrepareCustomConfig"
PrepareSecureCustomConfig = "PrepareSecureCustomConfig"
ReconfigureSecurityAdmin = "ReconfigureSecurityAdmin"

HorizontalScaleMasterNode = "HorizontalScaleMasterNode"
HorizontalScaleDataNode = "HorizontalScaleDataNode"
HorizontalScaleDataHotNode = "HorizontalScaleDataHotNode"
HorizontalScaleDataWarmNode = "HorizontalScaleDataWarmNode"
HorizontalScaleDataColdNode = "HorizontalScaleDataColdNode"
HorizontalScaleDataFrozenNode = "HorizontalScaleDataFrozenNode"
HorizontalScaleDataContentNode = "HorizontalScaleDataContentNode"
HorizontalScaleMLNode = "HorizontalScaleMLNode"
HorizontalScaleTransformNode = "HorizontalScaleTransformNode"
HorizontalScaleCoordinatingNode = "HorizontalScaleCoordinatingNode"
HorizontalScaleIngestNode = "HorizontalScaleIngestNode"
HorizontalScaleCombinedNode = "HorizontalScaleCombinedNode"

VolumeExpansionCombinedNode = "VolumeExpansionCombinedNode"
VolumeExpansionMasterNode = "VolumeExpansionMasterNode"
VolumeExpansionIngestNode = "VolumeExpansionIngestNode"
VolumeExpansionDataNode = "VolumeExpansionDataNode"
VolumeExpansionDataContentNode = "VolumeExpansionDataContentNode"
VolumeExpansionDataHotNode = "VolumeExpansionDataHotNode"
VolumeExpansionDataWarmNode = "VolumeExpansionDataWarmNode"
VolumeExpansionDataColdNode = "VolumeExpansionDataColdNode"
VolumeExpansionDataFrozenNode = "VolumeExpansionDataFrozenNode"
VolumeExpansionMLNode = "VolumeExpansionMLNode"
VolumeExpansionTransformNode = "VolumeExpansionTransformNode"
VolumeExpansionCoordinatingNode = "VolumeExpansionCoordinatingNode"
)

// MongoDB Constants
const (
StartingBalancer = "StartingBalancer"
StoppingBalancer = "StoppingBalancer"
FlushRouterConfig = "FlushRouterConfig"

UpdateStandaloneImage = "UpdateStandaloneImage"
UpdateShardImage = "UpdateShardImage"
UpdateReplicaSetImage = "UpdateReplicaSetImage"
UpdateConfigServerImage = "UpdateConfigServerImage"
UpdateMongosImage = "UpdateMongosImage"

HorizontalScaleStandaloneUp = "HorizontalScaleStandaloneUp"
HorizontalScaleStandaloneDown = "HorizontalScaleStandaloneDown"
HorizontalScaleReplicaSetUp = "HorizontalScaleReplicaSetUp"
HorizontalScaleReplicaSetDown = "HorizontalScaleReplicaSetDown"
HorizontalScaleMongos = "HorizontalScaleMongos"
HorizontalScaleConfigServerUp = "HorizontalScaleConfigServerUp"
HorizontalScaleConfigServerDown = "HorizontalScaleConfigServerDown"
HorizontalScaleShardReplicasUp = "HorizontalScaleShardReplicasUp"
HorizontalScaleShardReplicasDown = "HorizontalScaleShardReplicasDown"
HorizontalScaleShardUp = "HorizontalScaleShardUp"
HorizontalScaleShardDown = "HorizontalScaleShardDown"
HorizontalScaleArbiterUp = "HorizontalScaleArbiterUp"
HorizontalScaleArbiterDown = "HorizontalScaleArbiterDown"
HorizontalScaleHiddenUp = "HorizontalScaleHiddenUp"
HorizontalScaleHiddenDown = "HorizontalScaleHiddenDown"

VerticalScaleStandalone = "VerticalScaleStandalone"
VerticalScaleReplicaSet = "VerticalScaleReplicaSet"
VerticalScaleMongos = "VerticalScaleMongos"
VerticalScaleConfigServer = "VerticalScaleConfigServer"
VerticalScaleShard = "VerticalScaleShard"
VerticalScaleArbiter = "VerticalScaleArbiter"
VerticalScaleHidden = "VerticalScaleHidden"

VolumeExpansionStandalone = "VolumeExpansionStandalone"
VolumeExpansionReplicaSet = "VolumeExpansionReplicaSet"
VolumeExpansionMongos = "VolumeExpansionMongos"
VolumeExpansionConfigServer = "VolumeExpansionConfigServer"
VolumeExpansionShard = "VolumeExpansionShard"
VolumeExpansionHidden = "VolumeExpansionHidden"

ReconfigureStandalone = "ReconfigureStandalone"
ReconfigureReplicaset = "ReconfigureReplicaset"
ReconfigureMongos = "ReconfigureMongos"
ReconfigureConfigServer = "ReconfigureConfigServer"
ReconfigureShard = "ReconfigureShard"
ReconfigureArbiter = "ReconfigureArbiter"
ReconfigureHidden = "ReconfigureHidden"

RestartStandalone = "RestartStandalone"
RestartReplicaSet = "RestartReplicaSet"
RestartMongos = "RestartMongos"
RestartConfigServer = "RestartConfigServer"
RestartShard = "RestartShard"
RestartArbiter = "RestartArbiter"
RestartHidden = "RestartHidden"
)

// MySQL/MariaDB Constants
const (
TempIniFilesPath = "/tmp/kubedb-custom-ini-files"
)

// Postgres Constants
const (
PausePgCoordinator = "PausePgCoordinator"
ResumePgCoordinator = "ResumePgCoordinator"
DataDirectoryInitialized = "DataDirectoryInitialized"
ReplacedDataDirectory = "ReplacedDataDirectory"
TransferLeaderShipToFirstNode = "TransferPrimaryRoleToDefault"
TransferLeaderShipToFirstNodeBeforeCoordinatorPaused = "TransferLeaderShipToFirstNodeBeforeCoordinatorPaused"
CopiedOldBinaries = "CopiedOldBinaries"
ResumePrimaryPgCoordinator = "NonTransferableResumePgCoordinator"

UpdatePrimaryImage = "UpdatePrimaryImage"
UpdateStandbyImage = "UpdateStandbyImage"

RestartPrimary = "RestartPrimary"
RestartSecondary = "RestartSecondary"
)

// Redis Constants
const (
PatchedSecret = "patchedSecret"
ConfigKeyRedis = "redis.conf"
RedisTLSArg = "--tls-port 6379"
ReplaceSentinel = "ReplaceSentinel"
ScaleUpRedisReplicasInSentinelMode = "ScaleUpRedisReplicasInSentinelMode"
ScaleDownRedisReplicasInSentinelMode = "ScaleDownRedisReplicasInSentinelMode"

// ======================= Condition Reasons ========================

OpsRequestProgressingStarted = "OpsRequestProgressingStarted"
OpsRequestFailedToProgressing = "OpsRequestFailedToProgressing"
SuccessfullyPausedDatabase = "SuccessfullyPausedDatabase"
FailedToPauseDatabase = "FailedToPauseDatabase"
SuccessfullyResumedDatabase = "SuccessfullyResumedDatabase"
FailedToResumedDatabase = "FailedToResumedDatabase"
DatabaseVersionUpgradingStarted = "DatabaseVersionUpgradingStarted"
SuccessfullyUpgradedDatabaseVersion = "SuccessfullyUpgradedDatabaseVersion"
FailedToUpgradeDatabaseVersion = "FailedToUpgradeDatabaseVersion"
HorizontalScalingStarted = "HorizontalScalingStarted"
SuccessfullyPerformedHorizontalScaling = "SuccessfullyPerformedHorizontalScaling"
FailedToPerformHorizontalScaling = "FailedToPerformHorizontalScaling"
VerticalScalingStarted = "VerticalScalingStarted"
SuccessfullyPerformedVerticalScaling = "SuccessfullyPerformedVerticalScaling"
FailedToPerformVerticalScaling = "FailedToPerformVerticalScaling"
OpsRequestProcessedSuccessfully = "OpsRequestProcessedSuccessfully"
SuccessfullyVolumeExpanded = "SuccessfullyVolumeExpanded"
FailedToVolumeExpand = "FailedToVolumeExpand"
SuccessfullyDBReconfigured = "SuccessfullyDBReconfigured"
FailedToReconfigureDB = "FailedToReconfigureDB"
SuccessfullyRestartedDBMembers = "SuccessfullyRestartedDBMembers"
FailToRestartDBMembers = "FailToRestartDBMembers"
SuccessfullyRestartedStatefulSet = "SuccessfullyRestartedStatefulSet"
FailedToRestartStatefulSet = "FailedToRestartStatefulSet"
SuccessfullyRemovedTLSConfig = "SuccessfullyRemovedTLSConfig"
FailedToRemoveTLSConfig = "FailedToRemoveTLSConfig"
SuccessfullyAddedTLSConfig = "SuccessfullyAddedTLSConfig"
FailedToAddTLSConfig = "FailedToAddTLSConfig"
SuccessfullyIssuedCertificates = "SuccessfullyIssuedCertificates"
FailedToIssueCertificates = "FailedToIssueCertificates"
SuccessfullyReconfiguredTLS = "SuccessfullyReconfiguredTLS"
HorizontalScaleReplicasUp = "HorizontalScaleReplicasUp"
HorizontalScaleReplicasDown = "HorizontalScaleReplicasDown"
HorizontalScaleSentinelUp = "HorizontalScaleSentinelUp"
HorizontalScaleSentinelDown = "HorizontalScaleSentinelDown"
)
Loading

0 comments on commit eda8efd

Please sign in to comment.