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