mirror of
https://github.com/cloudnative-pg/plugin-barman-cloud.git
synced 2026-07-08 18:52:20 +02:00
Compare commits
4 Commits
030726eb6b
...
a95ff9d80b
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
a95ff9d80b | ||
|
|
6b75e4974d | ||
|
|
9eb2f70f54 | ||
|
|
eefb45ca5a |
10
Taskfile.yml
10
Taskfile.yml
@ -46,7 +46,7 @@ tasks:
|
|||||||
- wordlist-ordered
|
- wordlist-ordered
|
||||||
env:
|
env:
|
||||||
# renovate: datasource=git-refs depName=spellcheck lookupName=https://github.com/cloudnative-pg/daggerverse currentValue=main
|
# renovate: datasource=git-refs depName=spellcheck lookupName=https://github.com/cloudnative-pg/daggerverse currentValue=main
|
||||||
DAGGER_SPELLCHECK_SHA: 2429c90cf92445de356493fcf908bcc7af68dddc
|
DAGGER_SPELLCHECK_SHA: 537e0ddae55ad0344af8f4454de7f27baeee48fa
|
||||||
cmds:
|
cmds:
|
||||||
- >
|
- >
|
||||||
GITHUB_REF= dagger -s call -m github.com/cloudnative-pg/daggerverse/spellcheck@${DAGGER_SPELLCHECK_SHA}
|
GITHUB_REF= dagger -s call -m github.com/cloudnative-pg/daggerverse/spellcheck@${DAGGER_SPELLCHECK_SHA}
|
||||||
@ -60,7 +60,7 @@ tasks:
|
|||||||
desc: Check for conventional commits
|
desc: Check for conventional commits
|
||||||
env:
|
env:
|
||||||
# renovate: datasource=git-refs depName=commitlint lookupName=https://github.com/cloudnative-pg/daggerverse currentValue=main
|
# renovate: datasource=git-refs depName=commitlint lookupName=https://github.com/cloudnative-pg/daggerverse currentValue=main
|
||||||
DAGGER_COMMITLINT_SHA: 2429c90cf92445de356493fcf908bcc7af68dddc
|
DAGGER_COMMITLINT_SHA: 537e0ddae55ad0344af8f4454de7f27baeee48fa
|
||||||
cmds:
|
cmds:
|
||||||
- >
|
- >
|
||||||
GITHUB_REF= dagger -s call -m github.com/cloudnative-pg/daggerverse/commitlint@${DAGGER_COMMITLINT_SHA}
|
GITHUB_REF= dagger -s call -m github.com/cloudnative-pg/daggerverse/commitlint@${DAGGER_COMMITLINT_SHA}
|
||||||
@ -74,7 +74,7 @@ tasks:
|
|||||||
- wordlist-ordered
|
- wordlist-ordered
|
||||||
env:
|
env:
|
||||||
# renovate: datasource=git-refs depName=uncommitted lookupName=https://github.com/cloudnative-pg/daggerverse currentValue=main
|
# renovate: datasource=git-refs depName=uncommitted lookupName=https://github.com/cloudnative-pg/daggerverse currentValue=main
|
||||||
DAGGER_UNCOMMITTED_SHA: 2429c90cf92445de356493fcf908bcc7af68dddc
|
DAGGER_UNCOMMITTED_SHA: 537e0ddae55ad0344af8f4454de7f27baeee48fa
|
||||||
cmds:
|
cmds:
|
||||||
- GITHUB_REF= dagger -s call -m github.com/cloudnative-pg/daggerverse/uncommitted@${DAGGER_UNCOMMITTED_SHA} check-uncommitted --source . stdout
|
- GITHUB_REF= dagger -s call -m github.com/cloudnative-pg/daggerverse/uncommitted@${DAGGER_UNCOMMITTED_SHA} check-uncommitted --source . stdout
|
||||||
sources:
|
sources:
|
||||||
@ -86,7 +86,7 @@ tasks:
|
|||||||
- controller-gen
|
- controller-gen
|
||||||
env:
|
env:
|
||||||
# renovate: datasource=git-refs depName=crd-gen-refs lookupName=https://github.com/cloudnative-pg/daggerverse currentValue=main
|
# renovate: datasource=git-refs depName=crd-gen-refs lookupName=https://github.com/cloudnative-pg/daggerverse currentValue=main
|
||||||
DAGGER_CRDGENREF_SHA: 2429c90cf92445de356493fcf908bcc7af68dddc
|
DAGGER_CRDGENREF_SHA: 537e0ddae55ad0344af8f4454de7f27baeee48fa
|
||||||
# renovate: datasource=go depName=github.com/elastic/crd-ref-docs
|
# renovate: datasource=go depName=github.com/elastic/crd-ref-docs
|
||||||
CRDREFDOCS_VERSION: v0.3.0
|
CRDREFDOCS_VERSION: v0.3.0
|
||||||
cmds:
|
cmds:
|
||||||
@ -381,7 +381,7 @@ tasks:
|
|||||||
run: once
|
run: once
|
||||||
env:
|
env:
|
||||||
# renovate: datasource=git-refs depName=controller-gen lookupName=https://github.com/cloudnative-pg/daggerverse currentValue=main
|
# renovate: datasource=git-refs depName=controller-gen lookupName=https://github.com/cloudnative-pg/daggerverse currentValue=main
|
||||||
DAGGER_CONTROLLER_GEN_SHA: 2429c90cf92445de356493fcf908bcc7af68dddc
|
DAGGER_CONTROLLER_GEN_SHA: 537e0ddae55ad0344af8f4454de7f27baeee48fa
|
||||||
cmds:
|
cmds:
|
||||||
- >
|
- >
|
||||||
GITHUB_REF= dagger -s call -m github.com/cloudnative-pg/daggerverse/controller-gen@${DAGGER_CONTROLLER_GEN_SHA}
|
GITHUB_REF= dagger -s call -m github.com/cloudnative-pg/daggerverse/controller-gen@${DAGGER_CONTROLLER_GEN_SHA}
|
||||||
|
|||||||
@ -33,7 +33,8 @@ import (
|
|||||||
)
|
)
|
||||||
|
|
||||||
// updateRecoveryWindow updates the recovery window inside the object
|
// 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(
|
func updateRecoveryWindow(
|
||||||
ctx context.Context,
|
ctx context.Context,
|
||||||
c client.Client,
|
c client.Client,
|
||||||
@ -41,6 +42,14 @@ func updateRecoveryWindow(
|
|||||||
objectStore *barmancloudv1.ObjectStore,
|
objectStore *barmancloudv1.ObjectStore,
|
||||||
serverName string,
|
serverName string,
|
||||||
) error {
|
) error {
|
||||||
|
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
|
||||||
|
}
|
||||||
|
|
||||||
// Set the recovery window inside the barman object store object
|
// Set the recovery window inside the barman object store object
|
||||||
convertTime := func(t *time.Time) *metav1.Time {
|
convertTime := func(t *time.Time) *metav1.Time {
|
||||||
if t == nil {
|
if t == nil {
|
||||||
@ -49,16 +58,17 @@ func updateRecoveryWindow(
|
|||||||
return ptr.To(metav1.NewTime(*t))
|
return ptr.To(metav1.NewTime(*t))
|
||||||
}
|
}
|
||||||
|
|
||||||
recoveryWindow := objectStore.Status.ServerRecoveryWindow[serverName]
|
recoveryWindow := freshObjectStore.Status.ServerRecoveryWindow[serverName]
|
||||||
recoveryWindow.FirstRecoverabilityPoint = convertTime(backupList.GetFirstRecoverabilityPoint())
|
recoveryWindow.FirstRecoverabilityPoint = convertTime(backupList.GetFirstRecoverabilityPoint())
|
||||||
recoveryWindow.LastSuccessfulBackupTime = convertTime(backupList.GetLastSuccessfulBackupTime())
|
recoveryWindow.LastSuccessfulBackupTime = convertTime(backupList.GetLastSuccessfulBackupTime())
|
||||||
|
|
||||||
if objectStore.Status.ServerRecoveryWindow == nil {
|
if freshObjectStore.Status.ServerRecoveryWindow == nil {
|
||||||
objectStore.Status.ServerRecoveryWindow = make(map[string]barmancloudv1.RecoveryWindow)
|
freshObjectStore.Status.ServerRecoveryWindow = make(map[string]barmancloudv1.RecoveryWindow)
|
||||||
}
|
}
|
||||||
objectStore.Status.ServerRecoveryWindow[serverName] = recoveryWindow
|
freshObjectStore.Status.ServerRecoveryWindow[serverName] = recoveryWindow
|
||||||
|
|
||||||
return c.Status().Update(ctx, objectStore)
|
return c.Status().Update(ctx, &freshObjectStore)
|
||||||
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
// setLastFailedBackupTime sets the last failed backup time in the
|
// setLastFailedBackupTime sets the last failed backup time in the
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user