Skip to content

Commit 788eaf6

Browse files
armruleonardoce
authored andcommitted
chore: lint
Signed-off-by: Armando Ruocco <[email protected]>
1 parent efb5463 commit 788eaf6

File tree

8 files changed

+20
-10
lines changed

8 files changed

+20
-10
lines changed

cmd/manager/main.go

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@ import (
44
"fmt"
55
"os"
66

7-
87
"github.com/cloudnative-pg/machinery/pkg/log"
98
"github.com/spf13/cobra"
109

go.mod

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ require (
88
github.com/cloudnative-pg/barman-cloud v0.0.0-20240924124724-92831d48562a
99
github.com/cloudnative-pg/cloudnative-pg v1.24.1-0.20241017151552-20297270038b
1010
github.com/cloudnative-pg/cnpg-i v0.0.0-20241021130537-c4a74d755f0a
11-
github.com/cloudnative-pg/cnpg-i-machinery v0.0.0-20241017094517-76870f5660ef
11+
github.com/cloudnative-pg/cnpg-i-machinery v0.0.0-20241014090747-e9c2b3738d19
1212
github.com/cloudnative-pg/machinery v0.0.0-20241010122207-5ac7af31ef72
1313
github.com/onsi/ginkgo/v2 v2.20.2
1414
github.com/onsi/gomega v1.34.2

go.sum

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,8 +22,8 @@ github.com/cloudnative-pg/cloudnative-pg v1.24.1-0.20241017151552-20297270038b h
2222
github.com/cloudnative-pg/cloudnative-pg v1.24.1-0.20241017151552-20297270038b/go.mod h1:0grklCuA9WSA5lazBeTgDqLHjxP13fqAhqlveDx7hPg=
2323
github.com/cloudnative-pg/cnpg-i v0.0.0-20241021130537-c4a74d755f0a h1:K4c+gX96NAt9C3AeffB8T4tvI3Qn9Fpi5x7Kzd+Iiyg=
2424
github.com/cloudnative-pg/cnpg-i v0.0.0-20241021130537-c4a74d755f0a/go.mod h1:fAU7ySVzjpt/RZntxWZiWJCjaBJayzIxEnd0NuO7oQc=
25-
github.com/cloudnative-pg/cnpg-i-machinery v0.0.0-20241017094517-76870f5660ef h1:Og/btbliFYkJ2sz899T+b832GaFQU4ai52k98zZr0xA=
26-
github.com/cloudnative-pg/cnpg-i-machinery v0.0.0-20241017094517-76870f5660ef/go.mod h1:X6r1fRuUEIAv4+5SSBY2RmQ201K6GcptOXgnmaX/8tY=
25+
github.com/cloudnative-pg/cnpg-i-machinery v0.0.0-20241014090747-e9c2b3738d19 h1:qy+LrScvQpIwt4qeg9FfCJuoC9CbX/kpFGLF8vSobXg=
26+
github.com/cloudnative-pg/cnpg-i-machinery v0.0.0-20241014090747-e9c2b3738d19/go.mod h1:X6r1fRuUEIAv4+5SSBY2RmQ201K6GcptOXgnmaX/8tY=
2727
github.com/cloudnative-pg/machinery v0.0.0-20241010122207-5ac7af31ef72 h1:3pgtSYhv3RDd+51bnlqICNrcVpWQQvriCOvkxtbZpaE=
2828
github.com/cloudnative-pg/machinery v0.0.0-20241010122207-5ac7af31ef72/go.mod h1:bWp1Es5zlxElg4Z/c5f0RKOkDcyNvDHdYIvNcPQU4WM=
2929
github.com/cpuguy83/go-md2man/v2 v2.0.4/go.mod h1:tgQtvFlXSQOSOSIRvRPT7W67SCa46tRHOmNcaadrF8o=

internal/cnpgi/common/backup.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ import (
88
cnpgv1 "github.com/cloudnative-pg/cloudnative-pg/api/v1"
99
)
1010

11+
// GetCredentialsFromBackup extracts the Barman credentials from the backup
1112
func GetCredentialsFromBackup(backup *cnpgv1.Backup) (barmanapi.BarmanCredentials, error) {
1213
rawCred := backup.Status.PluginMetadata["credentials"]
1314

internal/cnpgi/common/doc.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
// Package common contains reusable structs and methods for CNPGI plugins.
2+
package common

internal/cnpgi/operator/reconciler.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,14 +8,14 @@ import (
88
"github.com/cloudnative-pg/cnpg-i-machinery/pkg/pluginhelper/object"
99
"github.com/cloudnative-pg/cnpg-i/pkg/reconciler"
1010
"github.com/cloudnative-pg/machinery/pkg/log"
11-
"github.com/cloudnative-pg/plugin-barman-cloud/internal/cnpgi/common"
1211
rbacv1 "k8s.io/api/rbac/v1"
1312
"k8s.io/apimachinery/pkg/api/equality"
1413
apierrs "k8s.io/apimachinery/pkg/api/errors"
1514
ctrl "sigs.k8s.io/controller-runtime"
1615
"sigs.k8s.io/controller-runtime/pkg/client"
1716

1817
barmancloudv1 "github.com/cloudnative-pg/plugin-barman-cloud/api/v1"
18+
"github.com/cloudnative-pg/plugin-barman-cloud/internal/cnpgi/common"
1919
"github.com/cloudnative-pg/plugin-barman-cloud/internal/cnpgi/operator/config"
2020
"github.com/cloudnative-pg/plugin-barman-cloud/internal/cnpgi/operator/specs"
2121
)

internal/cnpgi/operator/specs/role.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,9 @@ package specs
22

33
import (
44
"fmt"
5-
"github.com/cloudnative-pg/machinery/pkg/stringset"
65

76
cnpgv1 "github.com/cloudnative-pg/cloudnative-pg/api/v1"
7+
"github.com/cloudnative-pg/machinery/pkg/stringset"
88
rbacv1 "k8s.io/api/rbac/v1"
99
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
1010

internal/cnpgi/restore/restore.go

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,6 @@ import (
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

Comments
 (0)