From a6d4cd186dd8411b7c1e59aa3ff3ed1e99df7d55 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Charles-Edouard=20Br=C3=A9t=C3=A9ch=C3=A9?= Date: Tue, 17 May 2022 17:26:32 +0200 Subject: [PATCH] chore: make clients import aliases consistent (#3956) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * chore: make kyverno api import aliases consistent Signed-off-by: Charles-Edouard Brétéché * chore: make apimachinery api import aliases consistent Signed-off-by: Charles-Edouard Brétéché * chore: make dclient api import aliases consistent Signed-off-by: Charles-Edouard Brétéché * chore: make clients import aliases consistent Signed-off-by: Charles-Edouard Brétéché --- .golangci.yml | 4 ++++ pkg/policyreport/changerequestcreator.go | 6 +++--- pkg/policyreport/reportrequest.go | 4 ++-- 3 files changed, 9 insertions(+), 5 deletions(-) diff --git a/.golangci.yml b/.golangci.yml index 538b583f24..e9e85f3c19 100644 --- a/.golangci.yml +++ b/.golangci.yml @@ -55,3 +55,7 @@ linters-settings: alias: $1$2 - pkg: github.com/kyverno/kyverno/pkg/dclient alias: dclient + - pkg: github.com/kyverno/kyverno/pkg/client/clientset/versioned + alias: kyvernoclient + - pkg: k8s.io/client-go/kubernetes + alias: kubernetes diff --git a/pkg/policyreport/changerequestcreator.go b/pkg/policyreport/changerequestcreator.go index 2c99da42e0..84cc593fd2 100644 --- a/pkg/policyreport/changerequestcreator.go +++ b/pkg/policyreport/changerequestcreator.go @@ -9,7 +9,7 @@ import ( "time" "github.com/go-logr/logr" - policyreportclient "github.com/kyverno/kyverno/pkg/client/clientset/versioned" + kyvernoclient "github.com/kyverno/kyverno/pkg/client/clientset/versioned" "github.com/kyverno/kyverno/pkg/config" "github.com/patrickmn/go-cache" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" @@ -25,7 +25,7 @@ type creator interface { } type changeRequestCreator struct { - client policyreportclient.Interface + client kyvernoclient.Interface // addCache preserves requests that are to be added to report RCRCache *cache.Cache @@ -41,7 +41,7 @@ type changeRequestCreator struct { log logr.Logger } -func newChangeRequestCreator(client policyreportclient.Interface, tickerInterval time.Duration, log logr.Logger) creator { +func newChangeRequestCreator(client kyvernoclient.Interface, tickerInterval time.Duration, log logr.Logger) creator { return &changeRequestCreator{ client: client, RCRCache: cache.New(0, 24*time.Hour), diff --git a/pkg/policyreport/reportrequest.go b/pkg/policyreport/reportrequest.go index 989ce23c5b..af71e91419 100644 --- a/pkg/policyreport/reportrequest.go +++ b/pkg/policyreport/reportrequest.go @@ -10,7 +10,7 @@ import ( "github.com/go-logr/logr" kyvernov1 "github.com/kyverno/kyverno/api/kyverno/v1" - policyreportclient "github.com/kyverno/kyverno/pkg/client/clientset/versioned" + kyvernoclient "github.com/kyverno/kyverno/pkg/client/clientset/versioned" kyvernoinformer "github.com/kyverno/kyverno/pkg/client/informers/externalversions/kyverno/v1" requestinformer "github.com/kyverno/kyverno/pkg/client/informers/externalversions/kyverno/v1alpha2" kyvernolister "github.com/kyverno/kyverno/pkg/client/listers/kyverno/v1" @@ -50,7 +50,7 @@ type Generator struct { } // NewReportChangeRequestGenerator returns a new instance of report request generator -func NewReportChangeRequestGenerator(client policyreportclient.Interface, +func NewReportChangeRequestGenerator(client kyvernoclient.Interface, dclient dclient.Interface, reportReqInformer requestinformer.ReportChangeRequestInformer, clusterReportReqInformer requestinformer.ClusterReportChangeRequestInformer,