-
Notifications
You must be signed in to change notification settings - Fork 162
K8SPSMDB-1072: add retention section to backup tasks
#1928
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from 9 commits
8729890
f9b086f
6ab6283
1436357
29dfe95
b7f0ce5
deb4d75
c87ce9f
e9b7656
1baebc8
21f5606
4b5f654
be2e997
d21f06a
2f867bd
c8e7a48
01ad2b3
4ba045e
4ea859d
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -921,6 +921,7 @@ type BackupTaskSpec struct { | |
| Name string `json:"name"` | ||
| Enabled bool `json:"enabled"` | ||
| Keep int `json:"keep,omitempty"` | ||
| Retention BackupTaskSpecRetention `json:"retention,omitempty"` | ||
| Schedule string `json:"schedule,omitempty"` | ||
| StorageName string `json:"storageName,omitempty"` | ||
| CompressionType compress.CompressionType `json:"compressionType,omitempty"` | ||
|
|
@@ -930,6 +931,19 @@ type BackupTaskSpec struct { | |
| Type defs.BackupType `json:"type,omitempty"` | ||
| } | ||
|
|
||
| type BackupTaskSpecRetentionType string | ||
|
|
||
| const ( | ||
| BackupTaskSpecRetentionTypeCount = "count" | ||
| ) | ||
|
|
||
| type BackupTaskSpecRetention struct { | ||
| Count int `json:"count,omitempty"` | ||
| // +kubebuilder:validation:Enum={count} | ||
| Type string `json:"type,omitempty"` | ||
| DeleteFromStorage *bool `json:"deleteFromStorage,omitempty"` | ||
| } | ||
|
|
||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I believe that we could have a 1-1 mapping from
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. |
||
| func (task *BackupTaskSpec) JobName(cr *PerconaServerMongoDB) string { | ||
| return fmt.Sprintf("%s-backup-%s-%s", cr.Name, task.Name, cr.Namespace) | ||
| } | ||
|
|
||
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should we mark
keepas deprecated?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
1baebc8