github.com/1aal/kubeblocks@v0.0.0-20231107070852-e1c03e598921/pkg/dataprotection/types/constant.go (about) 1 /* 2 Copyright (C) 2022-2023 ApeCloud Co., Ltd 3 4 This file is part of KubeBlocks project 5 6 This program is free software: you can redistribute it and/or modify 7 it under the terms of the GNU Affero General Public License as published by 8 the Free Software Foundation, either version 3 of the License, or 9 (at your option) any later version. 10 11 This program is distributed in the hope that it will be useful 12 but WITHOUT ANY WARRANTY; without even the implied warranty of 13 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 GNU Affero General Public License for more details. 15 16 You should have received a copy of the GNU Affero General Public License 17 along with this program. If not, see <http://www.gnu.org/licenses/>. 18 */ 19 20 package types 21 22 // config keys used in viper 23 const ( 24 // CfgKeyGCFrequencySeconds is the key of gc frequency, its unit is second 25 CfgKeyGCFrequencySeconds = "GC_FREQUENCY_SECONDS" 26 ) 27 28 // config default values 29 const ( 30 // DefaultGCFrequencySeconds is the default gc frequency, its unit is second 31 DefaultGCFrequencySeconds = 60 * 60 32 ) 33 34 const ( 35 // DataProtectionFinalizerName is the name of our custom finalizer 36 DataProtectionFinalizerName = "dataprotection.kubeblocks.io/finalizer" 37 ) 38 39 // annotation keys 40 const ( 41 // DefaultBackupPolicyAnnotationKey specifies the default backup policy. 42 DefaultBackupPolicyAnnotationKey = "dataprotection.kubeblocks.io/is-default-policy" 43 // DefaultBackupPolicyTemplateAnnotationKey specifies the default backup policy template. 44 DefaultBackupPolicyTemplateAnnotationKey = "dataprotection.kubeblocks.io/is-default-policy-template" 45 // DefaultBackupRepoAnnotationKey specifies the default backup repo. 46 DefaultBackupRepoAnnotationKey = "dataprotection.kubeblocks.io/is-default-repo" 47 // ReconfigureRefAnnotationKey specifies the reconfigure ref. 48 ReconfigureRefAnnotationKey = "dataprotection.kubeblocks.io/reconfigure-ref" 49 ) 50 51 // label keys 52 const ( 53 // ClusterUIDLabelKey specifies the cluster UID label key. 54 ClusterUIDLabelKey = "dataprotection.kubeblocks.io/cluster-uid" 55 // BackupNameLabelKey specifies the backup name label key. 56 BackupNameLabelKey = "dataprotection.kubeblocks.io/backup-name" 57 // BackupScheduleLabelKey specifies the backup schedule label key. 58 BackupScheduleLabelKey = "dataprotection.kubeblocks.io/backup-schedule" 59 // BackupPolicyLabelKey specifies the backup policy label key. 60 BackupPolicyLabelKey = "dataprotection.kubeblocks.io/backup-policy" 61 // BackupMethodLabelKey specifies the backup method label key. 62 BackupMethodLabelKey = "dataprotection.kubeblocks.io/backup-method" 63 // BackupTypeLabelKey specifies the backup type label key. 64 BackupTypeLabelKey = "dataprotection.kubeblocks.io/backup-type" 65 // AutoBackupLabelKey specifies the auto backup label key. 66 AutoBackupLabelKey = "dataprotection.kubeblocks.io/autobackup" 67 // BackupTargetPodLabelKey specifies the backup target pod label key. 68 BackupTargetPodLabelKey = "dataprotection.kubeblocks.io/target-pod-name" 69 // ConnectionPasswordKey specifies the password of the connection credential. 70 ConnectionPasswordKey = "dataprotection.kubeblocks.io/connection-password" 71 ) 72 73 // env names 74 const ( 75 // DPDBHost database host for dataProtection 76 DPDBHost = "DP_DB_HOST" 77 // DPDBUser database user for dataProtection 78 DPDBUser = "DP_DB_USER" 79 // DPDBPassword database password for dataProtection 80 DPDBPassword = "DP_DB_PASSWORD" 81 // DPDBEndpoint database endpoint for dataProtection 82 DPDBEndpoint = "DP_DB_ENDPOINT" 83 // DPDBPort database port for dataProtection 84 DPDBPort = "DP_DB_PORT" 85 // DPTargetPodName the target pod name 86 DPTargetPodName = "DP_TARGET_POD_NAME" 87 // DPBackupBasePath the base path for backup data in the storage 88 DPBackupBasePath = "DP_BACKUP_BASE_PATH" 89 // DPBackupName backup CR name 90 DPBackupName = "DP_BACKUP_NAME" 91 // DPTTL backup time to live, reference the backup.spec.retentionPeriod 92 DPTTL = "DP_TTL" 93 // DPCheckInterval check interval for sync backup progress 94 DPCheckInterval = "DP_CHECK_INTERVAL" 95 // DPBackupInfoFile the file name which retains the backup.status info 96 DPBackupInfoFile = "DP_BACKUP_INFO_FILE" 97 // DPTimeFormat golang time format string 98 DPTimeFormat = "DP_TIME_FORMAT" 99 // DPBackupStopTime backup stop time 100 DPBackupStopTime = "DP_BACKUP_STOP_TIME" // backup stop time 101 // DPDatasafedBinPath the path containing the datasafed binary 102 DPDatasafedBinPath = "DP_DATASAFED_BIN_PATH" 103 // DPDatasafedLocalBackendPath force datasafed to use local backend with the path 104 // NOTE: do not add 'DP_' for this constant, it is the datasafed built-in environment. 105 DPDatasafedLocalBackendPath = "DATASAFED_LOCAL_BACKEND_PATH" 106 ) 107 108 const ( 109 RestoreKind = "Restore" 110 DataprotectionAPIGroup = "dataprotection.kubeblocks.io" 111 )