From 8bd56842b1183d20c3998c6b8198787c4cd63f7a Mon Sep 17 00:00:00 2001 From: Leonardo Cecchi Date: Wed, 2 Oct 2024 09:41:41 +0200 Subject: [PATCH] chore: maker linter happy Signed-off-by: Leonardo Cecchi --- .golangci.yml | 2 +- cmd/instance/main.go | 2 +- internal/cnpgi/instance/manager.go | 10 +++++----- internal/cnpgi/operator/lifecycle.go | 3 ++- internal/operator/manager/manager.go | 4 +--- kubernetes/kustomization.yaml | 4 +++- 6 files changed, 13 insertions(+), 12 deletions(-) diff --git a/.golangci.yml b/.golangci.yml index 67f4b07..5148a0b 100644 --- a/.golangci.yml +++ b/.golangci.yml @@ -131,4 +131,4 @@ issues: - test exclude-files: - zz_generated.* - - internal/controller/suite_test.go + - internal/operator/controller/suite_test.go diff --git a/cmd/instance/main.go b/cmd/instance/main.go index 177ff35..a228ce1 100644 --- a/cmd/instance/main.go +++ b/cmd/instance/main.go @@ -23,7 +23,7 @@ func main() { logFlags.ConfigureLogging() return nil }, - RunE: func(cmd *cobra.Command, args []string) error { + RunE: func(cmd *cobra.Command, _ []string) error { requiredSettings := []string{ "namespace", "barman-object-name", diff --git a/internal/cnpgi/instance/manager.go b/internal/cnpgi/instance/manager.go index ea662db..18e8ff4 100644 --- a/internal/cnpgi/instance/manager.go +++ b/internal/cnpgi/instance/manager.go @@ -9,6 +9,7 @@ import ( "github.com/spf13/viper" "k8s.io/apimachinery/pkg/fields" "k8s.io/apimachinery/pkg/runtime" + utilruntime "k8s.io/apimachinery/pkg/util/runtime" ctrl "sigs.k8s.io/controller-runtime" "sigs.k8s.io/controller-runtime/pkg/cache" "sigs.k8s.io/controller-runtime/pkg/client" @@ -17,15 +18,14 @@ import ( barmancloudv1 "github.com/cloudnative-pg/plugin-barman-cloud/api/v1" ) -var ( - scheme = runtime.NewScheme() -) +var scheme = runtime.NewScheme() func init() { - _ = barmancloudv1.AddToScheme(scheme) - _ = cnpgv1.AddToScheme(scheme) + utilruntime.Must(barmancloudv1.AddToScheme(scheme)) + utilruntime.Must(cnpgv1.AddToScheme(scheme)) } +// Start starts the sidecar informers and CNPG-i server func Start(ctx context.Context) error { setupLog := log.FromContext(ctx) setupLog.Info("Starting barman cloud instance plugin") diff --git a/internal/cnpgi/operator/lifecycle.go b/internal/cnpgi/operator/lifecycle.go index 0e10e69..8781cdd 100644 --- a/internal/cnpgi/operator/lifecycle.go +++ b/internal/cnpgi/operator/lifecycle.go @@ -9,9 +9,10 @@ import ( "github.com/cloudnative-pg/cnpg-i-machinery/pkg/pluginhelper/object" "github.com/cloudnative-pg/cnpg-i/pkg/lifecycle" "github.com/cloudnative-pg/machinery/pkg/log" - "github.com/cloudnative-pg/plugin-barman-cloud/internal/cnpgi/metadata" "github.com/spf13/viper" corev1 "k8s.io/api/core/v1" + + "github.com/cloudnative-pg/plugin-barman-cloud/internal/cnpgi/metadata" ) // LifecycleImplementation is the implementation of the lifecycle handler diff --git a/internal/operator/manager/manager.go b/internal/operator/manager/manager.go index 609c0f5..ad37848 100644 --- a/internal/operator/manager/manager.go +++ b/internal/operator/manager/manager.go @@ -43,9 +43,7 @@ import ( _ "k8s.io/client-go/plugin/pkg/client/auth" ) -var ( - scheme = runtime.NewScheme() -) +var scheme = runtime.NewScheme() func init() { utilruntime.Must(clientgoscheme.AddToScheme(scheme)) diff --git a/kubernetes/kustomization.yaml b/kubernetes/kustomization.yaml index eebeee0..31d8603 100644 --- a/kubernetes/kustomization.yaml +++ b/kubernetes/kustomization.yaml @@ -11,7 +11,9 @@ resources: - ../config/rbac images: - name: plugin-barman-cloud + newName: kind.local/github.com/cloudnative-pg/plugin-barman-cloud/cmd/operator + newTag: 634ab82d4f8b68ffada6033b7dff817bbed61a2fec8e05f9ebf74f5bedafb0dd secretGenerator: - literals: - - SIDECAR_IMAGE=plugin-sidecar + - SIDECAR_IMAGE=kind.local/github.com/cloudnative-pg/plugin-barman-cloud/cmd/instance:7173a2dcf3ce74e982ca3d35053de40fcec67b31d607a0d12547b4f9d09c535c name: plugin-barman-cloud