mirror of
https://github.com/cloudnative-pg/plugin-barman-cloud.git
synced 2026-01-11 21:23:12 +01:00
chore: improve logging
Signed-off-by: Marco Nenciarini <marco.nenciarini@enterprisedb.com>
This commit is contained in:
parent
37b4aa9214
commit
64e9702502
@ -88,11 +88,14 @@ func (w WALServiceImplementation) Archive(
|
||||
ctx context.Context,
|
||||
request *wal.WALArchiveRequest,
|
||||
) (*wal.WALArchiveResult, error) {
|
||||
contextLogger := log.FromContext(ctx)
|
||||
contextLogger.Debug("starting wal archive")
|
||||
|
||||
baseWalName := path.Base(request.GetSourceFileName())
|
||||
|
||||
contextLogger := log.FromContext(ctx)
|
||||
contextLogger.Debug("wal archive start", "walName", baseWalName)
|
||||
defer func() {
|
||||
contextLogger.Debug("wal archive end", "walName", baseWalName)
|
||||
}()
|
||||
|
||||
// Step 1: parse the configuration and get the environment variables needed
|
||||
// for barman-cloud-wal-archive
|
||||
configuration, err := config.NewFromClusterJSON(request.ClusterDefinition)
|
||||
@ -115,6 +118,7 @@ func (w WALServiceImplementation) Archive(
|
||||
)
|
||||
if err != nil {
|
||||
if apierrors.IsForbidden(err) {
|
||||
contextLogger.Info(ErrMissingPermissions.Error())
|
||||
return nil, ErrMissingPermissions
|
||||
}
|
||||
return nil, err
|
||||
|
||||
Loading…
Reference in New Issue
Block a user