mirror of
https://github.com/cloudnative-pg/plugin-barman-cloud.git
synced 2026-09-06 06:52:21 +02:00
Compare commits
4 Commits
a5217ed780
...
f1405e2a74
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
f1405e2a74 | ||
|
|
f38a3e3a08 | ||
|
|
5ff12acda0 | ||
|
|
eefb45ca5a |
@ -33,7 +33,8 @@ import (
|
||||
)
|
||||
|
||||
// updateRecoveryWindow updates the recovery window inside the object
|
||||
// store status subresource
|
||||
// store status subresource. It uses retry logic to handle concurrent
|
||||
// updates from backup completion and retention policy enforcement.
|
||||
func updateRecoveryWindow(
|
||||
ctx context.Context,
|
||||
c client.Client,
|
||||
@ -41,24 +42,33 @@ func updateRecoveryWindow(
|
||||
objectStore *barmancloudv1.ObjectStore,
|
||||
serverName string,
|
||||
) error {
|
||||
// Set the recovery window inside the barman object store object
|
||||
convertTime := func(t *time.Time) *metav1.Time {
|
||||
if t == nil {
|
||||
return nil
|
||||
objectStoreKey := client.ObjectKeyFromObject(objectStore)
|
||||
|
||||
return retry.RetryOnConflict(retry.DefaultBackoff, func() error {
|
||||
var freshObjectStore barmancloudv1.ObjectStore
|
||||
if err := c.Get(ctx, objectStoreKey, &freshObjectStore); err != nil {
|
||||
return err
|
||||
}
|
||||
return ptr.To(metav1.NewTime(*t))
|
||||
}
|
||||
|
||||
recoveryWindow := objectStore.Status.ServerRecoveryWindow[serverName]
|
||||
recoveryWindow.FirstRecoverabilityPoint = convertTime(backupList.GetFirstRecoverabilityPoint())
|
||||
recoveryWindow.LastSuccessfulBackupTime = convertTime(backupList.GetLastSuccessfulBackupTime())
|
||||
// Set the recovery window inside the barman object store object
|
||||
convertTime := func(t *time.Time) *metav1.Time {
|
||||
if t == nil {
|
||||
return nil
|
||||
}
|
||||
return ptr.To(metav1.NewTime(*t))
|
||||
}
|
||||
|
||||
if objectStore.Status.ServerRecoveryWindow == nil {
|
||||
objectStore.Status.ServerRecoveryWindow = make(map[string]barmancloudv1.RecoveryWindow)
|
||||
}
|
||||
objectStore.Status.ServerRecoveryWindow[serverName] = recoveryWindow
|
||||
recoveryWindow := freshObjectStore.Status.ServerRecoveryWindow[serverName]
|
||||
recoveryWindow.FirstRecoverabilityPoint = convertTime(backupList.GetFirstRecoverabilityPoint())
|
||||
recoveryWindow.LastSuccessfulBackupTime = convertTime(backupList.GetLastSuccessfulBackupTime())
|
||||
|
||||
return c.Status().Update(ctx, objectStore)
|
||||
if freshObjectStore.Status.ServerRecoveryWindow == nil {
|
||||
freshObjectStore.Status.ServerRecoveryWindow = make(map[string]barmancloudv1.RecoveryWindow)
|
||||
}
|
||||
freshObjectStore.Status.ServerRecoveryWindow[serverName] = recoveryWindow
|
||||
|
||||
return c.Status().Update(ctx, &freshObjectStore)
|
||||
})
|
||||
}
|
||||
|
||||
// setLastFailedBackupTime sets the last failed backup time in the
|
||||
|
||||
@ -73,7 +73,7 @@ func newAzuriteDeployment(namespace, name string) *appsv1.Deployment {
|
||||
Name: name,
|
||||
// renovate: datasource=docker depName=mcr.microsoft.com/azure-storage/azurite versioning=docker
|
||||
// Version: 3.36.0
|
||||
Image: "mcr.microsoft.com/azure-storage/azurite@sha256:37493d0f2e764467421ffe16eb3caa39277e5fa7f6adea18eb5bbfb3c5247f98",
|
||||
Image: "mcr.microsoft.com/azure-storage/azurite@sha256:76b8127d608fab8287a14a4bfeb9a5502cdcffb4bf1e86f09f324ebb0e70edba",
|
||||
Args: []string{
|
||||
"azurite-blob",
|
||||
"--blobHost",
|
||||
|
||||
@ -121,8 +121,8 @@ func newS3ClientDeployment(namespace string) *appsv1.Deployment {
|
||||
{
|
||||
Name: s3ClientName,
|
||||
// renovate: datasource=docker depName=amazon/aws-cli versioning=docker
|
||||
// Version: 2.36.8
|
||||
Image: "docker.io/amazon/aws-cli@sha256:7e1b11a3c93bc5af81f496de0662f666b2352a4a6666e8ebae904fe102b131b6",
|
||||
// Version: 2.36.9
|
||||
Image: "docker.io/amazon/aws-cli@sha256:00dee8ccaf669721f8163944ea9e6ac13183851b23d5b7a9868a608bc932cfdb",
|
||||
Command: []string{"sleep", "infinity"},
|
||||
Env: []corev1.EnvVar{
|
||||
{
|
||||
|
||||
Loading…
Reference in New Issue
Block a user