Skip to content

Commit

Permalink
add passiveDeadlineSeconds
Browse files Browse the repository at this point in the history
  • Loading branch information
egegunes committed Jan 20, 2025
1 parent a0cb71c commit 77eddf5
Show file tree
Hide file tree
Showing 13 changed files with 215 additions and 50 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -144,6 +144,9 @@ spec:
type: object
type: array
type: object
passiveDeadlineSeconds:
format: int64
type: integer
pxcCluster:
type: string
storageName:
Expand Down Expand Up @@ -203,6 +206,8 @@ spec:
type: array
destination:
type: string
error:
type: string
image:
type: string
lastscheduled:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -101,6 +101,8 @@ spec:
type: array
destination:
type: string
error:
type: string
image:
type: string
lastscheduled:
Expand Down Expand Up @@ -275,6 +277,8 @@ spec:
type: array
destination:
type: string
error:
type: string
image:
type: string
lastscheduled:
Expand Down
3 changes: 3 additions & 0 deletions config/crd/bases/pxc.percona.com_perconaxtradbclusters.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,9 @@ spec:
type: object
x-kubernetes-map-type: atomic
type: array
passiveDeadlineSeconds:
format: int64
type: integer
pitr:
properties:
enabled:
Expand Down
1 change: 1 addition & 0 deletions deploy/backup/backup.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ spec:
pxcCluster: cluster1
storageName: fs-pvc
# activeDeadlineSeconds: 3600
passiveDeadlineSeconds: 30
# containerOptions:
# env:
# - name: VERIFY_TLS
Expand Down
12 changes: 12 additions & 0 deletions deploy/bundle.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -143,6 +143,9 @@ spec:
type: object
type: array
type: object
passiveDeadlineSeconds:
format: int64
type: integer
pxcCluster:
type: string
storageName:
Expand Down Expand Up @@ -202,6 +205,8 @@ spec:
type: array
destination:
type: string
error:
type: string
image:
type: string
lastscheduled:
Expand Down Expand Up @@ -344,6 +349,8 @@ spec:
type: array
destination:
type: string
error:
type: string
image:
type: string
lastscheduled:
Expand Down Expand Up @@ -518,6 +525,8 @@ spec:
type: array
destination:
type: string
error:
type: string
image:
type: string
lastscheduled:
Expand Down Expand Up @@ -985,6 +994,9 @@ spec:
type: object
x-kubernetes-map-type: atomic
type: array
passiveDeadlineSeconds:
format: int64
type: integer
pitr:
properties:
enabled:
Expand Down
1 change: 1 addition & 0 deletions deploy/cr.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -592,6 +592,7 @@ spec:
image: perconalab/percona-xtradb-cluster-operator:main-pxc8.0-backup
# backoffLimit: 6
# activeDeadlineSeconds: 3600
# passiveDeadlineSeconds: 300
# serviceAccountName: percona-xtradb-cluster-operator
# imagePullSecrets:
# - name: private-registry-credentials
Expand Down
12 changes: 12 additions & 0 deletions deploy/crd.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -143,6 +143,9 @@ spec:
type: object
type: array
type: object
passiveDeadlineSeconds:
format: int64
type: integer
pxcCluster:
type: string
storageName:
Expand Down Expand Up @@ -202,6 +205,8 @@ spec:
type: array
destination:
type: string
error:
type: string
image:
type: string
lastscheduled:
Expand Down Expand Up @@ -344,6 +349,8 @@ spec:
type: array
destination:
type: string
error:
type: string
image:
type: string
lastscheduled:
Expand Down Expand Up @@ -518,6 +525,8 @@ spec:
type: array
destination:
type: string
error:
type: string
image:
type: string
lastscheduled:
Expand Down Expand Up @@ -985,6 +994,9 @@ spec:
type: object
x-kubernetes-map-type: atomic
type: array
passiveDeadlineSeconds:
format: int64
type: integer
pitr:
properties:
enabled:
Expand Down
12 changes: 12 additions & 0 deletions deploy/cw-bundle.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -143,6 +143,9 @@ spec:
type: object
type: array
type: object
passiveDeadlineSeconds:
format: int64
type: integer
pxcCluster:
type: string
storageName:
Expand Down Expand Up @@ -202,6 +205,8 @@ spec:
type: array
destination:
type: string
error:
type: string
image:
type: string
lastscheduled:
Expand Down Expand Up @@ -344,6 +349,8 @@ spec:
type: array
destination:
type: string
error:
type: string
image:
type: string
lastscheduled:
Expand Down Expand Up @@ -518,6 +525,8 @@ spec:
type: array
destination:
type: string
error:
type: string
image:
type: string
lastscheduled:
Expand Down Expand Up @@ -985,6 +994,9 @@ spec:
type: object
x-kubernetes-map-type: atomic
type: array
passiveDeadlineSeconds:
format: int64
type: integer
pitr:
properties:
enabled:
Expand Down
10 changes: 6 additions & 4 deletions pkg/apis/pxc/v1/pxc_backup_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -47,14 +47,16 @@ type PerconaXtraDBClusterBackup struct {
}

type PXCBackupSpec struct {
PXCCluster string `json:"pxcCluster"`
StorageName string `json:"storageName,omitempty"`
ContainerOptions *BackupContainerOptions `json:"containerOptions,omitempty"`
ActiveDeadlineSeconds *int64 `json:"activeDeadlineSeconds,omitempty"`
PXCCluster string `json:"pxcCluster"`
StorageName string `json:"storageName,omitempty"`
ContainerOptions *BackupContainerOptions `json:"containerOptions,omitempty"`
PassiveDeadlineSeconds *int64 `json:"passiveDeadlineSeconds,omitempty"`
ActiveDeadlineSeconds *int64 `json:"activeDeadlineSeconds,omitempty"`
}

type PXCBackupStatus struct {
State PXCBackupState `json:"state,omitempty"`
Error string `json:"error,omitempty"`
CompletedAt *metav1.Time `json:"completed,omitempty"`
LastScheduled *metav1.Time `json:"lastscheduled,omitempty"`
Destination PXCBackupDestination `json:"destination,omitempty"`
Expand Down
23 changes: 12 additions & 11 deletions pkg/apis/pxc/v1/pxc_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -160,17 +160,18 @@ const (
)

type PXCScheduledBackup struct {
AllowParallel *bool `json:"allowParallel,omitempty"`
Image string `json:"image,omitempty"`
ImagePullSecrets []corev1.LocalObjectReference `json:"imagePullSecrets,omitempty"`
ImagePullPolicy corev1.PullPolicy `json:"imagePullPolicy,omitempty"`
Schedule []PXCScheduledBackupSchedule `json:"schedule,omitempty"`
Storages map[string]*BackupStorageSpec `json:"storages,omitempty"`
ServiceAccountName string `json:"serviceAccountName,omitempty"`
Annotations map[string]string `json:"annotations,omitempty"`
PITR PITRSpec `json:"pitr,omitempty"`
BackoffLimit *int32 `json:"backoffLimit,omitempty"`
ActiveDeadlineSeconds *int64 `json:"activeDeadlineSeconds,omitempty"`
AllowParallel *bool `json:"allowParallel,omitempty"`
Image string `json:"image,omitempty"`
ImagePullSecrets []corev1.LocalObjectReference `json:"imagePullSecrets,omitempty"`
ImagePullPolicy corev1.PullPolicy `json:"imagePullPolicy,omitempty"`
Schedule []PXCScheduledBackupSchedule `json:"schedule,omitempty"`
Storages map[string]*BackupStorageSpec `json:"storages,omitempty"`
ServiceAccountName string `json:"serviceAccountName,omitempty"`
Annotations map[string]string `json:"annotations,omitempty"`
PITR PITRSpec `json:"pitr,omitempty"`
BackoffLimit *int32 `json:"backoffLimit,omitempty"`
ActiveDeadlineSeconds *int64 `json:"activeDeadlineSeconds,omitempty"`
PassiveDeadlineSeconds *int64 `json:"passiveDeadlineSeconds,omitempty"`
}

func (b *PXCScheduledBackup) GetAllowParallel() bool {
Expand Down
10 changes: 10 additions & 0 deletions pkg/apis/pxc/v1/zz_generated.deepcopy.go

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

5 changes: 3 additions & 2 deletions pkg/controller/pxc/backup.go
Original file line number Diff line number Diff line change
Expand Up @@ -222,8 +222,9 @@ func (r *ReconcilePerconaXtraDBCluster) createBackupJob(ctx context.Context, cr
Labels: naming.LabelsScheduledBackup(cr, backupJob.Name),
},
Spec: api.PXCBackupSpec{
PXCCluster: cr.Name,
StorageName: backupJob.StorageName,
PXCCluster: cr.Name,
StorageName: backupJob.StorageName,
PassiveDeadlineSeconds: cr.Spec.Backup.PassiveDeadlineSeconds,
},
}
err = r.client.Create(context.TODO(), bcp)
Expand Down
Loading

0 comments on commit 77eddf5

Please sign in to comment.