Skip to content

Commit

Permalink
Update manifest restore APIs (#132)
Browse files Browse the repository at this point in the history
Signed-off-by: hmsayem <[email protected]>
Co-authored-by: Md. Ishtiaq Islam <[email protected]>
  • Loading branch information
hmsayem and ishtiaqhimel authored Sep 20, 2024
1 parent f5d4345 commit 6f40843
Show file tree
Hide file tree
Showing 3 changed files with 123 additions and 66 deletions.
48 changes: 31 additions & 17 deletions apis/core/v1alpha1/restoresession_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -75,9 +75,9 @@ type RestoreSessionSpec struct {
}

type ManifestRestoreOptions struct {
// RestoreNamespace specifies the Namespace where the restored files will be applied
//+optional
RestoreNamespace string `json:"restoreNamespace,omitempty"`
// Workload specifies the options for Workload components to restore in manifest restore
// +optional
Workload *WorkloadManifestOptions `json:"workload,omitempty"`

// MongoDB specifies the options for selecting particular MongoDB components to restore in manifest restore
// +optional
Expand Down Expand Up @@ -112,8 +112,19 @@ type ManifestRestoreOptions struct {
Redis *KubeDBManifestOptions `json:"redis,omitempty"`
}

type WorkloadManifestOptions struct {
// RestoreNamespace specifies the Namespace where the restored files will be applied
// +optional
RestoreNamespace string `json:"restoreNamespace,omitempty"`
}

type MSSQLServerManifestOptions struct {
// RestoreNamespace specifies the Namespace where the restored files will be applied
// +optional
RestoreNamespace string `json:"restoreNamespace,omitempty"`

// DB specifies whether to restore the DB manifest or not
// +kubebuilder:default=true
// +optional
DB bool `json:"db,omitempty"`

Expand All @@ -122,6 +133,7 @@ type MSSQLServerManifestOptions struct {
DBName string `json:"dbName,omitempty"`

// AuthSecret specifies whether to restore the AuthSecret manifest or not
// +kubebuilder:default=true
// +optional
AuthSecret bool `json:"authSecret,omitempty"`

Expand All @@ -139,7 +151,12 @@ type MSSQLServerManifestOptions struct {
}

type DruidManifestOptions struct {
// RestoreNamespace specifies the Namespace where the restored files will be applied
// +optional
RestoreNamespace string `json:"restoreNamespace,omitempty"`

// DB specifies whether to restore the DB manifest or not
// +kubebuilder:default=true
// +optional
DB bool `json:"db,omitempty"`

Expand All @@ -148,6 +165,7 @@ type DruidManifestOptions struct {
DBName string `json:"dbName,omitempty"`

// AuthSecret specifies whether to restore the AuthSecret manifest or not
// +kubebuilder:default=true
// +optional
AuthSecret bool `json:"authSecret,omitempty"`

Expand All @@ -156,6 +174,7 @@ type DruidManifestOptions struct {
AuthSecretName string `json:"authSecretName,omitempty"`

// ConfigSecret specifies whether to restore the ConfigSecret manifest or not
// +kubebuilder:default=true
// +optional
ConfigSecret bool `json:"configSecret,omitempty"`

Expand All @@ -164,26 +183,18 @@ type DruidManifestOptions struct {
ConfigSecretName string `json:"configSecretName,omitempty"`

// DeepStorageSecret specifies whether to restore the DeepStorageSecret manifest or not
// +kubebuilder:default=true
// +optional
DeepStorageSecret bool `json:"deepStorageSecret,omitempty"`

// MetadataStorage specifies new configuration of the Metadata Storage after restore
// +optional
MetadataStorage bool `json:"metadataStorage,omitempty"`

// +optional
MetadataStorageRef *kmapi.ObjectReference `json:"metadataStorageRef,omitempty"`

// ZooKeeper specifies new configuration of the Metadata Storage after restore
// +optional
Zookeeper bool `json:"zookeeper,omitempty"`

// +optional
ZookeeperRef *kmapi.ObjectReference `json:"zookeeperRef,omitempty"`
}

type KubeDBManifestOptions struct {
// RestoreNamespace specifies the Namespace where the restored files will be applied
// +optional
RestoreNamespace string `json:"restoreNamespace,omitempty"`

// DB specifies whether to restore the DB manifest or not
// +kubebuilder:default=true
// +optional
DB bool `json:"db,omitempty"`

Expand All @@ -192,6 +203,7 @@ type KubeDBManifestOptions struct {
DBName string `json:"dbName,omitempty"`

// AuthSecret specifies whether to restore the AuthSecret manifest or not
// +kubebuilder:default=true
// +optional
AuthSecret bool `json:"authSecret,omitempty"`

Expand All @@ -200,6 +212,7 @@ type KubeDBManifestOptions struct {
AuthSecretName string `json:"authSecretName,omitempty"`

// ConfigSecret specifies whether to restore the ConfigSecret manifest or not
// +kubebuilder:default=true
// +optional
ConfigSecret bool `json:"configSecret,omitempty"`

Expand All @@ -208,6 +221,7 @@ type KubeDBManifestOptions struct {
ConfigSecretName string `json:"configSecretName,omitempty"`

// InitScript specifies whether to restore the InitScript manifest or not
// +kubebuilder:default=true
// +optional
InitScript bool `json:"initScript,omitempty"`

Expand Down
32 changes: 21 additions & 11 deletions apis/core/v1alpha1/zz_generated.deepcopy.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit 6f40843

Please sign in to comment.