From 3d364be6628eb4e0adc7873e97bc9eb874e971e5 Mon Sep 17 00:00:00 2001 From: wanglong <46259301+gnolong@users.noreply.github.com> Date: Mon, 2 Dec 2024 10:45:03 +0800 Subject: [PATCH] fix: add Selective backupType (#8553) --- apis/dataprotection/v1alpha1/actionset_types.go | 6 ++++-- .../crd/bases/dataprotection.kubeblocks.io_actionsets.yaml | 3 +++ .../helm/crds/dataprotection.kubeblocks.io_actionsets.yaml | 3 +++ docs/developer_docs/api-reference/backup.md | 4 ++++ pkg/dataprotection/backup/request.go | 2 +- pkg/dataprotection/restore/utils.go | 2 +- pkg/testutil/dataprotection/utils.go | 1 + 7 files changed, 17 insertions(+), 4 deletions(-) diff --git a/apis/dataprotection/v1alpha1/actionset_types.go b/apis/dataprotection/v1alpha1/actionset_types.go index 42cd81a6bf5..f10c032d0b8 100644 --- a/apis/dataprotection/v1alpha1/actionset_types.go +++ b/apis/dataprotection/v1alpha1/actionset_types.go @@ -29,10 +29,11 @@ type ActionSetSpec struct { // - `Incremental` back up data that have changed since the last backup (either full or incremental). // - `Differential` back up data that has changed since the last full backup. // - `Continuous` back up transaction logs continuously, such as MySQL binlog, PostgreSQL WAL, etc. + // - `Selective` back up data more precisely, use custom parameters, such as specific databases or tables. // // Continuous backup is essential for implementing Point-in-Time Recovery (PITR). // - // +kubebuilder:validation:Enum={Full,Incremental,Differential,Continuous} + // +kubebuilder:validation:Enum={Full,Incremental,Differential,Continuous,Selective} // +kubebuilder:default=Full // +kubebuilder:validation:Required BackupType BackupType `json:"backupType"` @@ -91,7 +92,7 @@ type ActionSetStatus struct { // BackupType the backup type. // +enum -// +kubebuilder:validation:Enum={Full,Incremental,Differential,Continuous} +// +kubebuilder:validation:Enum={Full,Incremental,Differential,Continuous,Selective} type BackupType string const ( @@ -99,6 +100,7 @@ const ( BackupTypeIncremental BackupType = "Incremental" BackupTypeDifferential BackupType = "Differential" BackupTypeContinuous BackupType = "Continuous" + BackupTypeSelective BackupType = "Selective" ) type BackupActionSpec struct { diff --git a/config/crd/bases/dataprotection.kubeblocks.io_actionsets.yaml b/config/crd/bases/dataprotection.kubeblocks.io_actionsets.yaml index 71b5f38182c..70f0c913412 100644 --- a/config/crd/bases/dataprotection.kubeblocks.io_actionsets.yaml +++ b/config/crd/bases/dataprotection.kubeblocks.io_actionsets.yaml @@ -282,11 +282,13 @@ spec: - Incremental - Differential - Continuous + - Selective - enum: - Full - Incremental - Differential - Continuous + - Selective default: Full description: |- Specifies the backup type. Supported values include: @@ -296,6 +298,7 @@ spec: - `Incremental` back up data that have changed since the last backup (either full or incremental). - `Differential` back up data that has changed since the last full backup. - `Continuous` back up transaction logs continuously, such as MySQL binlog, PostgreSQL WAL, etc. + - `Selective` back up data more precisely, use custom parameters, such as specific databases or tables. Continuous backup is essential for implementing Point-in-Time Recovery (PITR). diff --git a/deploy/helm/crds/dataprotection.kubeblocks.io_actionsets.yaml b/deploy/helm/crds/dataprotection.kubeblocks.io_actionsets.yaml index 71b5f38182c..70f0c913412 100644 --- a/deploy/helm/crds/dataprotection.kubeblocks.io_actionsets.yaml +++ b/deploy/helm/crds/dataprotection.kubeblocks.io_actionsets.yaml @@ -282,11 +282,13 @@ spec: - Incremental - Differential - Continuous + - Selective - enum: - Full - Incremental - Differential - Continuous + - Selective default: Full description: |- Specifies the backup type. Supported values include: @@ -296,6 +298,7 @@ spec: - `Incremental` back up data that have changed since the last backup (either full or incremental). - `Differential` back up data that has changed since the last full backup. - `Continuous` back up transaction logs continuously, such as MySQL binlog, PostgreSQL WAL, etc. + - `Selective` back up data more precisely, use custom parameters, such as specific databases or tables. Continuous backup is essential for implementing Point-in-Time Recovery (PITR). diff --git a/docs/developer_docs/api-reference/backup.md b/docs/developer_docs/api-reference/backup.md index e4a3d1c1773..ec66150f503 100644 --- a/docs/developer_docs/api-reference/backup.md +++ b/docs/developer_docs/api-reference/backup.md @@ -102,6 +102,7 @@ BackupType
Incremental
back up data that have changed since the last backup (either full or incremental).Differential
back up data that has changed since the last full backup.Continuous
back up transaction logs continuously, such as MySQL binlog, PostgreSQL WAL, etc.Selective
back up data more precisely, use custom parameters, such as specific databases or tables.Continuous backup is essential for implementing Point-in-Time Recovery (PITR).
@@ -1348,6 +1349,7 @@ BackupTypeIncremental
back up data that have changed since the last backup (either full or incremental).Differential
back up data that has changed since the last full backup.Continuous
back up transaction logs continuously, such as MySQL binlog, PostgreSQL WAL, etc.Selective
back up data more precisely, use custom parameters, such as specific databases or tables.Continuous backup is essential for implementing Point-in-Time Recovery (PITR).
@@ -3773,6 +3775,8 @@ Kubernetes meta/v1.Time"Incremental"
"Selective"