44 "context"
55 "errors"
66 "fmt"
7- "github.com/cloudnative-pg/cnpg-i-machinery/pkg/pluginhelper/decoder"
8- "github.com/cloudnative-pg/plugin-barman-cloud/internal/cnpgi/common"
97 "os"
108 "os/exec"
119 "path"
@@ -19,13 +17,15 @@ import (
1917 barmanRestorer "github.com/cloudnative-pg/barman-cloud/pkg/restorer"
2018 cnpgv1 "github.com/cloudnative-pg/cloudnative-pg/api/v1"
2119 "github.com/cloudnative-pg/cloudnative-pg/pkg/utils"
20+ "github.com/cloudnative-pg/cnpg-i-machinery/pkg/pluginhelper/decoder"
2221 restore "github.com/cloudnative-pg/cnpg-i/pkg/restore/job"
2322 "github.com/cloudnative-pg/machinery/pkg/execlog"
2423 "github.com/cloudnative-pg/machinery/pkg/fileutils"
2524 "github.com/cloudnative-pg/machinery/pkg/log"
2625 "sigs.k8s.io/controller-runtime/pkg/client"
2726
2827 barmancloudv1 "github.com/cloudnative-pg/plugin-barman-cloud/api/v1"
28+ "github.com/cloudnative-pg/plugin-barman-cloud/internal/cnpgi/common"
2929 "github.com/cloudnative-pg/plugin-barman-cloud/internal/cnpgi/metadata"
3030)
3131
@@ -71,7 +71,11 @@ func (impl JobHookImpl) Restore(
7171) (* restore.RestoreResponse , error ) {
7272 contextLogger := log .FromContext (ctx )
7373 var cluster cnpgv1.Cluster
74- if err := decoder .DecodeObject (req .GetClusterDefinition (), & cluster , cnpgv1 .GroupVersion .WithKind ("Cluster" )); err != nil {
74+ if err := decoder .DecodeObject (
75+ req .GetClusterDefinition (),
76+ & cluster ,
77+ cnpgv1 .GroupVersion .WithKind ("Cluster" ),
78+ ); err != nil {
7579 return nil , err
7680 }
7781 // Before starting the restore we check if the archive destination is safe to use
@@ -82,7 +86,11 @@ func (impl JobHookImpl) Restore(
8286
8387 var backup cnpgv1.Backup
8488
85- if err := decoder .DecodeObject (req .GetBackupDefinition (), & backup , cnpgv1 .GroupVersion .WithKind ("Backup" )); err != nil {
89+ if err := decoder .DecodeObject (
90+ req .GetBackupDefinition (),
91+ & backup ,
92+ cnpgv1 .GroupVersion .WithKind ("Backup" ),
93+ ); err != nil {
8694 return nil , err
8795 }
8896
0 commit comments