From 17789bb03e6409655a38e10780c128d78b061aee Mon Sep 17 00:00:00 2001 From: ehco1996 Date: Fri, 21 Jul 2023 11:45:50 +0800 Subject: [PATCH] backup: make LogBackupTemplate optional --- docs/api-references/docs.md | 4 ++-- manifests/crd.yaml | 2 +- manifests/crd/v1/pingcap.com_backupschedules.yaml | 2 +- manifests/crd/v1beta1/pingcap.com_backupschedules.yaml | 2 +- manifests/crd_v1beta1.yaml | 2 +- pkg/apis/pingcap/v1alpha1/openapi_generated.go | 2 +- pkg/apis/pingcap/v1alpha1/types.go | 2 +- 7 files changed, 8 insertions(+), 8 deletions(-) diff --git a/docs/api-references/docs.md b/docs/api-references/docs.md index 5fff84eab1..fe4997b11e 100644 --- a/docs/api-references/docs.md +++ b/docs/api-references/docs.md @@ -564,7 +564,6 @@ BackupSpec -(Optional)

BackupTemplate is the specification of the backup structure to get scheduled.

@@ -578,6 +577,7 @@ BackupSpec +(Optional)

LogBackupTemplate is the specification of the log backup structure to get scheduled.

@@ -3631,7 +3631,6 @@ BackupSpec -(Optional)

BackupTemplate is the specification of the backup structure to get scheduled.

@@ -3645,6 +3644,7 @@ BackupSpec +(Optional)

LogBackupTemplate is the specification of the log backup structure to get scheduled.

diff --git a/manifests/crd.yaml b/manifests/crd.yaml index 9bd86e2119..354fa4d11b 100644 --- a/manifests/crd.yaml +++ b/manifests/crd.yaml @@ -4232,7 +4232,7 @@ spec: storageSize: type: string required: - - logBackupTemplate + - backupTemplate - schedule type: object status: diff --git a/manifests/crd/v1/pingcap.com_backupschedules.yaml b/manifests/crd/v1/pingcap.com_backupschedules.yaml index 2de9a5ab62..d0f8cce473 100644 --- a/manifests/crd/v1/pingcap.com_backupschedules.yaml +++ b/manifests/crd/v1/pingcap.com_backupschedules.yaml @@ -2705,7 +2705,7 @@ spec: storageSize: type: string required: - - logBackupTemplate + - backupTemplate - schedule type: object status: diff --git a/manifests/crd/v1beta1/pingcap.com_backupschedules.yaml b/manifests/crd/v1beta1/pingcap.com_backupschedules.yaml index 77a53c7e35..03d1e60028 100644 --- a/manifests/crd/v1beta1/pingcap.com_backupschedules.yaml +++ b/manifests/crd/v1beta1/pingcap.com_backupschedules.yaml @@ -2695,7 +2695,7 @@ spec: storageSize: type: string required: - - logBackupTemplate + - backupTemplate - schedule type: object status: diff --git a/manifests/crd_v1beta1.yaml b/manifests/crd_v1beta1.yaml index b75ef4421d..25ab0235f1 100644 --- a/manifests/crd_v1beta1.yaml +++ b/manifests/crd_v1beta1.yaml @@ -4219,7 +4219,7 @@ spec: storageSize: type: string required: - - logBackupTemplate + - backupTemplate - schedule type: object status: diff --git a/pkg/apis/pingcap/v1alpha1/openapi_generated.go b/pkg/apis/pingcap/v1alpha1/openapi_generated.go index 0f83f83268..6af294150b 100644 --- a/pkg/apis/pingcap/v1alpha1/openapi_generated.go +++ b/pkg/apis/pingcap/v1alpha1/openapi_generated.go @@ -929,7 +929,7 @@ func schema_pkg_apis_pingcap_v1alpha1_BackupScheduleSpec(ref common.ReferenceCal }, }, }, - Required: []string{"schedule", "logBackupTemplate"}, + Required: []string{"schedule", "backupTemplate"}, }, }, Dependencies: []string{ diff --git a/pkg/apis/pingcap/v1alpha1/types.go b/pkg/apis/pingcap/v1alpha1/types.go index bbeb4a47b0..0dcf73f0ff 100644 --- a/pkg/apis/pingcap/v1alpha1/types.go +++ b/pkg/apis/pingcap/v1alpha1/types.go @@ -2154,9 +2154,9 @@ type BackupScheduleSpec struct { // MaxReservedTime is to specify how long backups we want to keep. MaxReservedTime *string `json:"maxReservedTime,omitempty"` // BackupTemplate is the specification of the backup structure to get scheduled. - // +optional BackupTemplate BackupSpec `json:"backupTemplate"` // LogBackupTemplate is the specification of the log backup structure to get scheduled. + // +optional LogBackupTemplate *BackupSpec `json:"logBackupTemplate"` // The storageClassName of the persistent volume for Backup data storage if not storage class name set in BackupSpec. // Defaults to Kubernetes default storage class.