Skip to content

Commit b614356

Browse files
committed
update const
Signed-off-by: SK Ali Arman <arman@appscode.com>
1 parent 41bd332 commit b614356

File tree

4 files changed

+48
-9
lines changed

4 files changed

+48
-9
lines changed

apis/kubedb/constants.go

Lines changed: 32 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,7 @@ const (
6262
DistributedDBReplicaENV = "DB_REPLICAS"
6363
DistributedMaxVolumeUsed = "max_used"
6464
DistributedVolumeCapacity = "capacity"
65+
KubesliceContainerExcludeLabel = "kubeslice.io/exclude"
6566

6667
KubeSliceNSMIPKey = "kubeslice.io/nsmIP"
6768
KubeSlicePodIPVolumeName = "podip"
@@ -398,13 +399,37 @@ const (
398399
DatabasePodMasterComponent = "Master"
399400
DatabasePodSlaveComponent = "Slave"
400401

401-
MariaDBDistributedUpgradeCommand = "mariadb-upgrade"
402-
MariaDBDistributedPodMetricGetCommand = "get-pod-metrics"
403-
MariaDBDistributedPodGetCommand = "get-pod"
404-
MariaDBDistributedVolumeUsageGetCommand = "get-volume-usage"
405-
MariaDBDistributedVolumeCapacityGetCommand = "get-volume-capacity"
406-
MariaDBDistributedBackupCommand = "take-backup"
407-
MariaDBDistributedRestoreCommand = "restore-backup"
402+
MariaDBDistributedUpgradeCommand = "mariadb-upgrade"
403+
MariaDBDistributedPodMetricGetCommand = "get-pod-metrics"
404+
MariaDBDistributedPodGetCommand = "get-pod"
405+
MariaDBDistributedVolumeUsageGetCommand = "get-volume-usage"
406+
MariaDBDistributedVolumeCapacityGetCommand = "get-volume-capacity"
407+
MariaDBDistributedBackupCommand = "take-backup"
408+
MariaDBDistributedRestoreCommand = "restore-backup"
409+
MariaDBDistributedRecoveryFileCreateCommand = "create-recovery-done-file"
410+
MariaDBArchiverPVCRestorerSuffix = "pvc-restorer"
411+
MariaDBBinlogRestoreSidekickSuffix = "binlog-restorer"
412+
MariaDBBinlogRestoreServiceSuffix = "binlog-restore"
413+
MariaDBXtraBackupInfoFile = "/var/lib/mysql/mariadb_backup_binlog_info"
414+
MariaDBBackupInfoFile = "/var/lib/mysql/xtrabackup_binlog_info"
415+
MariaDBArchiverRestoreRecoveryFileName = "/tmp/recovery.done"
416+
MariaDBArchiverBackupJobSelector = GroupName + "/archiver-job-name"
417+
MariaDBSidekickNameLabelKey = GroupName + "/sidekick-name"
418+
MariaDBArchiverBasebackupRestic = "Restic"
419+
MariaDBArchiverBasebackupVolumeSnapshooter = "VolumeSnapshotter"
420+
421+
// Distributed Archiver
422+
BackupsessionAnnotation = "kubestash.com/backupsession"
423+
RestoresessionAnnotation = "kubestash.com/restoresession"
424+
BackupconfigurationAnnotation = "kubestash.com/backupconfiguration"
425+
DistributedSnapshotinfoAnnotation = "kubestash.com/distributedsnapshotinfo"
426+
SnapshotsKey = "snapshots"
427+
RestoreSessionKey = "restoresession"
428+
DistributedArchiverBackupCMNameSuffix = "backup"
429+
DistributedArchiverRestoreCMNameSuffix = "restore"
430+
DistributedArchiverSnapshotCMNameSuffix = "snapshots"
431+
MariaDBKubestashBackupContainerName = "physical-backup-1"
432+
MariaDBKubestashRestoreContainerName = "distributed-physical-backup-restore-0"
408433

409434
// Maxscale
410435
MaxscaleCommonName = "mx"

apis/kubedb/v1/mariadb_helpers.go

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -114,6 +114,18 @@ func (m MariaDB) OffshootMaxscaleLabels() map[string]string {
114114
return m.offshootLabels(m.OffshootMaxscaleSelectors(), nil)
115115
}
116116

117+
func (m MariaDB) GetPVCRestoreSessionName(ordinal int) string {
118+
return fmt.Sprintf("%s-%s-%v-%s", kubedb.DefaultVolumeClaimTemplateName, m.OffshootName(), ordinal, kubedb.MariaDBArchiverPVCRestorerSuffix)
119+
}
120+
121+
func (m MariaDB) GetBinlogRestoreSidekickName(ordinal int) string {
122+
return fmt.Sprintf("%s-%s-%d", m.OffshootName(), kubedb.MariaDBBinlogRestoreSidekickSuffix, ordinal)
123+
}
124+
125+
func (m MariaDB) GetBinlogRestoreServiceName(ordinal int) string {
126+
return fmt.Sprintf("%s-%s-%d", m.OffshootName(), kubedb.MariaDBBinlogRestoreServiceSuffix, ordinal)
127+
}
128+
117129
func (m MariaDB) PodLabels() map[string]string {
118130
return m.offshootLabels(m.OffshootSelectors(), m.Spec.PodTemplate.Labels)
119131
}

pkg/utils/grpc/mariadb/protogen/api.pb.go

Lines changed: 3 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

pkg/utils/grpc/mariadb/protogen/api_grpc.pb.go

Lines changed: 1 addition & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)