Skip to content

Commit

Permalink
feat: enhance BackupSpec with RemoteConfig deep copy support
Browse files Browse the repository at this point in the history
- Add the RemoteConfig struct to BackupSpec with Enabled and StorageName fields.
- Update DeepCopy methods to include RemoteConfig and ensure it is deep-copied when present.
- Change RestoreSet's DeepCopyInto method to use the DeepCopyInto method for Spec and Status fields for proper copying.
- Enhance DeepCopyInto method to handle Apps slice in RestoreSetSpec, ensuring it is properly copied.

Signed-off-by: ysicing <[email protected]>
  • Loading branch information
ysicing committed Feb 14, 2025
1 parent c382985 commit 78b8d8f
Show file tree
Hide file tree
Showing 4 changed files with 88 additions and 16 deletions.
14 changes: 7 additions & 7 deletions client/clientset/versioned/fake/register.go

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

14 changes: 7 additions & 7 deletions client/clientset/versioned/scheme/register.go

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

8 changes: 8 additions & 0 deletions qucheng/v1beta1/backup_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,9 @@ type BackupSpec struct {
Namespace string `json:"namespace"`
StorageName string `json:"storageName,omitempty"`
Helm *HelmBackup `json:"helm,omitempty"`

// Remote define resticsnapshotdump and dbdump
Remote *RemoteConfig `json:"remote,omitempty"`
}

// BackupStatus defines the observed state of Backup
Expand Down Expand Up @@ -61,6 +64,11 @@ type HelmBackup struct {
Content string `json:"content,omitempty"`
}

type RemoteConfig struct {
Enabled bool `json:"enabled,omitempty"`
StorageName string `json:"storageName,omitempty"`
}

//+genclient
//+kubebuilder:printcolumn:name="Status",type="string",JSONPath=".status.phase",description="Backup status such as New/InProgress"
//+kubebuilder:object:root=true
Expand Down
68 changes: 66 additions & 2 deletions qucheng/v1beta1/zz_generated.deepcopy.go

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

0 comments on commit 78b8d8f

Please sign in to comment.