mirror of
https://github.com/cloudnative-pg/plugin-barman-cloud.git
synced 2026-01-11 13:23:09 +01:00
fix: avoid panicking if serverRecoveryWindow has still not been set (#525)
Closes: #523 Signed-off-by: Leonardo Cecchi <leonardo.cecchi@enterprisedb.com>
This commit is contained in:
parent
0ad066d195
commit
dfd9861a3f
@ -59,7 +59,12 @@ func setLastFailedBackupTime(
|
||||
}
|
||||
recoveryWindow := objectStore.Status.ServerRecoveryWindow[serverName]
|
||||
recoveryWindow.LastFailedBackupTime = ptr.To(metav1.NewTime(lastFailedBackupTime))
|
||||
|
||||
if objectStore.Status.ServerRecoveryWindow == nil {
|
||||
objectStore.Status.ServerRecoveryWindow = make(map[string]barmancloudv1.RecoveryWindow)
|
||||
}
|
||||
objectStore.Status.ServerRecoveryWindow[serverName] = recoveryWindow
|
||||
|
||||
return c.Status().Update(ctx, &objectStore)
|
||||
})
|
||||
}
|
||||
|
||||
Loading…
Reference in New Issue
Block a user