From af08c05c671d5194bfa83d9b81856d7223b2f022 Mon Sep 17 00:00:00 2001 From: Armando Ruocco Date: Mon, 12 Feb 2024 15:06:07 +0100 Subject: [PATCH] chore: minor stuff Signed-off-by: Armando Ruocco --- internal/backup/controldata.go | 1 + internal/backup/executor.go | 1 - internal/backup/storage/storage.go | 12 ++++++------ pkg/pluginhelper/server.go | 2 +- 4 files changed, 8 insertions(+), 8 deletions(-) diff --git a/internal/backup/controldata.go b/internal/backup/controldata.go index 62c99c9..c550ca4 100644 --- a/internal/backup/controldata.go +++ b/internal/backup/controldata.go @@ -11,6 +11,7 @@ import ( "github.com/cloudnative-pg/cloudnative-pg/pkg/management/url" "github.com/cloudnative-pg/cloudnative-pg/pkg/utils" + "github.com/cloudnative-pg/plugin-pvc-backup/pkg/logging" ) diff --git a/internal/backup/executor.go b/internal/backup/executor.go index 562e70e..6d31284 100644 --- a/internal/backup/executor.go +++ b/internal/backup/executor.go @@ -104,7 +104,6 @@ func (executor *Executor) Start(ctx context.Context) error { return nil }) - if err != nil { return err } diff --git a/internal/backup/storage/storage.go b/internal/backup/storage/storage.go index f44fbb5..6ed666d 100644 --- a/internal/backup/storage/storage.go +++ b/internal/backup/storage/storage.go @@ -12,9 +12,9 @@ func getWalPrefix(walName string) string { return walName[0:16] } -// GetClusterPath gets the path where the files relative +// getClusterPath gets the path where the files relative // to a cluster are stored -func GetClusterPath(clusterName string) string { +func getClusterPath(clusterName string) string { return path.Join(basePath, clusterName) } @@ -22,7 +22,7 @@ func GetClusterPath(clusterName string) string { // to a cluster are stored func GetWALPath(clusterName string) string { return path.Join( - GetClusterPath(clusterName), + getClusterPath(clusterName), walsDirectory, ) } @@ -31,7 +31,7 @@ func GetWALPath(clusterName string) string { // kopia configuration file will be written func GetKopiaConfigFilePath(clusterName string) string { return path.Join( - GetClusterPath(clusterName), + getClusterPath(clusterName), ".kopia.config", ) } @@ -40,7 +40,7 @@ func GetKopiaConfigFilePath(clusterName string) string { // kopia cache will be written func GetKopiaCacheDirectory(clusterName string) string { return path.Join( - GetClusterPath(clusterName), + getClusterPath(clusterName), ".kopia.cache", ) } @@ -49,7 +49,7 @@ func GetKopiaCacheDirectory(clusterName string) string { // to a cluster are stored func GetBasePath(clusterName string) string { return path.Join( - GetClusterPath(clusterName), + getClusterPath(clusterName), baseDirectory, ) } diff --git a/pkg/pluginhelper/server.go b/pkg/pluginhelper/server.go index 5df5b73..087416e 100644 --- a/pkg/pluginhelper/server.go +++ b/pkg/pluginhelper/server.go @@ -45,7 +45,7 @@ type ServerEnricher func(*grpc.Server) func CreateMainCmd(identityImpl identity.IdentityServer, enrichers ...ServerEnricher) *cobra.Command { cmd := &cobra.Command{ Use: "pvc-backup", - PersistentPreRun: func(cmd *cobra.Command, args []string) { + PersistentPreRun: func(cmd *cobra.Command, _ []string) { ctx := logging.IntoContext( cmd.Context(), viper.GetBool("debug"))