Skip to content
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

CLOUDP-228985: Support yearly frequency/retention for backup policy #1429

Merged
merged 1 commit into from
Mar 7, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions config/crd/bases/atlas.mongodb.com_atlasbackuppolicies.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,7 @@ spec:
- daily
- weekly
- monthly
- yearly
type: string
retentionUnit:
description: 'Scope of the backup policy item: days, weeks,
Expand All @@ -94,6 +95,7 @@ spec:
- days
- weeks
- months
- years
type: string
retentionValue:
description: Value to associate with RetentionUnit
Expand Down
4 changes: 2 additions & 2 deletions pkg/api/v1/atlasbackuppolicy_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ type AtlasBackupPolicySpec struct {

type AtlasBackupPolicyItem struct {
// Frequency associated with the backup policy item. One of the following values: hourly, daily, weekly or monthly. You cannot specify multiple hourly and daily backup policy items.
// +kubebuilder:validation:Enum:=hourly;daily;weekly;monthly
// +kubebuilder:validation:Enum:=hourly;daily;weekly;monthly;yearly
FrequencyType string `json:"frequencyType"`

// Desired frequency of the new backup policy item specified by FrequencyType. A value of 1 specifies the first instance of the corresponding FrequencyType.
Expand All @@ -31,7 +31,7 @@ type AtlasBackupPolicyItem struct {
FrequencyInterval int `json:"frequencyInterval"`

// Scope of the backup policy item: days, weeks, or months
// +kubebuilder:validation:Enum:=days;weeks;months
// +kubebuilder:validation:Enum:=days;weeks;months;years
RetentionUnit string `json:"retentionUnit"`

// Value to associate with RetentionUnit
Expand Down
6 changes: 6 additions & 0 deletions test/e2e/backup_config_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -126,6 +126,12 @@ func backupConfigFlow(data *model.TestDataProvider, bucket string) {
RetentionValue: 12,
RetentionUnit: "months",
},
{
FrequencyInterval: 1,
FrequencyType: "yearly",
RetentionValue: 1,
RetentionUnit: "years",
},
},
},
}
Expand Down
Loading