Skip to content

Commit 3d88eb8

Browse files
nmarukovichNatalia Marukovichhors
authored
K8SPSMDB-1319 Don't run scheduled backup if DB is unhealthy and startingDeadlineSeconds added. (#1940)
* K8SPSMDB-1319 * fix test * fix test * fix imports * fix * fix images * fix images * fix * fix PR comments * fix PR comments * fix labels after 1304 merge * fix labels * fix * fix PR comments * fix PR comments --------- Co-authored-by: Natalia Marukovich <nataliamarukovich@Natalias-MacBook-Pro.local> Co-authored-by: Viacheslav Sarzhan <slava.sarzhan@percona.com>
1 parent 03d4c52 commit 3d88eb8

File tree

15 files changed

+215
-5
lines changed

15 files changed

+215
-5
lines changed

config/crd/bases/psmdb.percona.com_perconaservermongodbbackups.yaml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,9 @@ spec:
6767
type: integer
6868
compressionType:
6969
type: string
70+
startingDeadlineSeconds:
71+
format: int64
72+
type: integer
7073
storageName:
7174
type: string
7275
type:

config/crd/bases/psmdb.percona.com_perconaservermongodbs.yaml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -298,6 +298,9 @@ spec:
298298
type: string
299299
serviceAccountName:
300300
type: string
301+
startingDeadlineSeconds:
302+
format: int64
303+
type: integer
301304
storages:
302305
additionalProperties:
303306
properties:

deploy/backup/backup.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,3 +10,4 @@ spec:
1010
# type: physical
1111
# compressionType: gzip
1212
# compressionLevel: 6
13+
# startingDeadlineSeconds: 300

deploy/bundle.yaml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -71,6 +71,9 @@ spec:
7171
type: integer
7272
compressionType:
7373
type: string
74+
startingDeadlineSeconds:
75+
format: int64
76+
type: integer
7477
storageName:
7578
type: string
7679
type:
@@ -1023,6 +1026,9 @@ spec:
10231026
type: string
10241027
serviceAccountName:
10251028
type: string
1029+
startingDeadlineSeconds:
1030+
format: int64
1031+
type: integer
10261032
storages:
10271033
additionalProperties:
10281034
properties:

deploy/cr.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -684,6 +684,7 @@ spec:
684684
backup:
685685
enabled: true
686686
image: perconalab/percona-server-mongodb-operator:main-backup
687+
# startingDeadlineSeconds: 300
687688
# annotations:
688689
# iam.amazonaws.com/role: role-arn
689690
# resources:

deploy/crd.yaml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -71,6 +71,9 @@ spec:
7171
type: integer
7272
compressionType:
7373
type: string
74+
startingDeadlineSeconds:
75+
format: int64
76+
type: integer
7477
storageName:
7578
type: string
7679
type:
@@ -1023,6 +1026,9 @@ spec:
10231026
type: string
10241027
serviceAccountName:
10251028
type: string
1029+
startingDeadlineSeconds:
1030+
format: int64
1031+
type: integer
10261032
storages:
10271033
additionalProperties:
10281034
properties:

deploy/cw-bundle.yaml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -71,6 +71,9 @@ spec:
7171
type: integer
7272
compressionType:
7373
type: string
74+
startingDeadlineSeconds:
75+
format: int64
76+
type: integer
7477
storageName:
7578
type: string
7679
type:
@@ -1023,6 +1026,9 @@ spec:
10231026
type: string
10241027
serviceAccountName:
10251028
type: string
1029+
startingDeadlineSeconds:
1030+
format: int64
1031+
type: integer
10261032
storages:
10271033
additionalProperties:
10281034
properties:

e2e-tests/version-service/conf/crd.yaml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -71,6 +71,9 @@ spec:
7171
type: integer
7272
compressionType:
7373
type: string
74+
startingDeadlineSeconds:
75+
format: int64
76+
type: integer
7477
storageName:
7578
type: string
7679
type:
@@ -1023,6 +1026,9 @@ spec:
10231026
type: string
10241027
serviceAccountName:
10251028
type: string
1029+
startingDeadlineSeconds:
1030+
format: int64
1031+
type: integer
10261032
storages:
10271033
additionalProperties:
10281034
properties:

pkg/apis/psmdb/v1/perconaservermongodbbackup_types.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,8 @@ type PerconaServerMongoDBBackupSpec struct {
1717
CompressionLevel *int `json:"compressionLevel,omitempty"`
1818

1919
// +kubebuilder:validation:Enum={logical,physical,incremental,incremental-base}
20-
Type defs.BackupType `json:"type,omitempty"`
20+
Type defs.BackupType `json:"type,omitempty"`
21+
StartingDeadlineSeconds *int64 `json:"startingDeadlineSeconds,omitempty"`
2122
}
2223

2324
type BackupState string
@@ -26,7 +27,6 @@ const (
2627
BackupStateNew BackupState = ""
2728
BackupStateWaiting BackupState = "waiting"
2829
BackupStateRequested BackupState = "requested"
29-
BackupStateRejected BackupState = "rejected"
3030
BackupStateRunning BackupState = "running"
3131
BackupStateError BackupState = "error"
3232
BackupStateReady BackupState = "ready"

pkg/apis/psmdb/v1/psmdb_types.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1106,6 +1106,7 @@ type BackupSpec struct {
11061106
PITR PITRSpec `json:"pitr,omitempty"`
11071107
Configuration BackupConfig `json:"configuration,omitempty"`
11081108
VolumeMounts []corev1.VolumeMount `json:"volumeMounts,omitempty"`
1109+
StartingDeadlineSeconds *int64 `json:"startingDeadlineSeconds,omitempty"`
11091110
}
11101111

11111112
func (b BackupSpec) IsPITREnabled() bool {

0 commit comments

Comments
 (0)