From e879c967685057f47db7b4e2e06613abb88f05d4 Mon Sep 17 00:00:00 2001 From: shunki-fujita Date: Tue, 6 Aug 2024 05:56:50 +0000 Subject: [PATCH] issue-725: add IncludeSchemas to RestoreSpec --- api/v1beta2/mysqlcluster_types.go | 4 ++++ api/v1beta2/zz_generated.deepcopy.go | 5 +++++ charts/moco/templates/generated/crds/moco_crds.yaml | 5 +++++ config/crd/bases/moco.cybozu.com_mysqlclusters.yaml | 5 +++++ ...stomresourcedefinition_mysqlclusters.moco.cybozu.com.yaml | 5 +++++ docs/crd_mysqlcluster_v1beta2.md | 1 + 6 files changed, 25 insertions(+) diff --git a/api/v1beta2/mysqlcluster_types.go b/api/v1beta2/mysqlcluster_types.go index d4315638e..6e9bd8f42 100644 --- a/api/v1beta2/mysqlcluster_types.go +++ b/api/v1beta2/mysqlcluster_types.go @@ -566,6 +566,10 @@ type RestoreSpec struct { // Specifies parameters for restore Pod. JobConfig `json:"jobConfig"` + + // IncludeSchemas is the list of schemas to restore. + // If empty, all schemas are restored. + IncludeSchemas []string `json:"includeSchemas,omitempty"` } // MySQLClusterStatus defines the observed state of MySQLCluster diff --git a/api/v1beta2/zz_generated.deepcopy.go b/api/v1beta2/zz_generated.deepcopy.go index a1f5cfc55..c39bcb12e 100644 --- a/api/v1beta2/zz_generated.deepcopy.go +++ b/api/v1beta2/zz_generated.deepcopy.go @@ -521,6 +521,11 @@ func (in *RestoreSpec) DeepCopyInto(out *RestoreSpec) { *out = *in in.RestorePoint.DeepCopyInto(&out.RestorePoint) in.JobConfig.DeepCopyInto(&out.JobConfig) + if in.IncludeSchemas != nil { + in, out := &in.IncludeSchemas, &out.IncludeSchemas + *out = make([]string, len(*in)) + copy(*out, *in) + } } // DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new RestoreSpec. diff --git a/charts/moco/templates/generated/crds/moco_crds.yaml b/charts/moco/templates/generated/crds/moco_crds.yaml index 1ab4e5a4b..21da3fab4 100644 --- a/charts/moco/templates/generated/crds/moco_crds.yaml +++ b/charts/moco/templates/generated/crds/moco_crds.yaml @@ -5817,6 +5817,11 @@ spec: restore: description: Restore is the specification to perform Point-in-T properties: + includeSchemas: + description: IncludeSchemas is the list of schemas to restore. + items: + type: string + type: array jobConfig: description: Specifies parameters for restore Pod. properties: diff --git a/config/crd/bases/moco.cybozu.com_mysqlclusters.yaml b/config/crd/bases/moco.cybozu.com_mysqlclusters.yaml index 1f91f55ac..0e12ec73d 100644 --- a/config/crd/bases/moco.cybozu.com_mysqlclusters.yaml +++ b/config/crd/bases/moco.cybozu.com_mysqlclusters.yaml @@ -4012,6 +4012,11 @@ spec: restore: description: Restore is the specification to perform Point-in-T properties: + includeSchemas: + description: IncludeSchemas is the list of schemas to restore. + items: + type: string + type: array jobConfig: description: Specifies parameters for restore Pod. properties: diff --git a/config/crd/tests/apiextensions.k8s.io_v1_customresourcedefinition_mysqlclusters.moco.cybozu.com.yaml b/config/crd/tests/apiextensions.k8s.io_v1_customresourcedefinition_mysqlclusters.moco.cybozu.com.yaml index 3351a2738..5880bc44c 100644 --- a/config/crd/tests/apiextensions.k8s.io_v1_customresourcedefinition_mysqlclusters.moco.cybozu.com.yaml +++ b/config/crd/tests/apiextensions.k8s.io_v1_customresourcedefinition_mysqlclusters.moco.cybozu.com.yaml @@ -4012,6 +4012,11 @@ spec: restore: description: Restore is the specification to perform Point-in-T properties: + includeSchemas: + description: IncludeSchemas is the list of schemas to restore. + items: + type: string + type: array jobConfig: description: Specifies parameters for restore Pod. properties: diff --git a/docs/crd_mysqlcluster_v1beta2.md b/docs/crd_mysqlcluster_v1beta2.md index 0647fdaa8..94628c46a 100644 --- a/docs/crd_mysqlcluster_v1beta2.md +++ b/docs/crd_mysqlcluster_v1beta2.md @@ -173,6 +173,7 @@ RestoreSpec represents a set of parameters for Point-in-Time Recovery. | sourceNamespace | SourceNamespace is the namespace of the source `MySQLCluster`. | string | true | | restorePoint | RestorePoint is the target date and time to restore data. The format is RFC3339. e.g. \"2006-01-02T15:04:05Z\" | [metav1.Time](https://pkg.go.dev/k8s.io/apimachinery/pkg/apis/meta/v1#Time) | true | | jobConfig | Specifies parameters for restore Pod. | [JobConfig](#jobconfig) | true | +| includeSchemas | IncludeSchemas is the list of schemas to restore. If empty, all schemas are restored. | []string | false | [Back to Custom Resources](#custom-resources)