From 12c2909d2786ada2810843bc23492f02db3bf801 Mon Sep 17 00:00:00 2001 From: shravan Date: Wed, 5 Feb 2020 16:29:37 +0530 Subject: [PATCH] 658 refactoring getall lookup name --- pkg/policystore/policystore.go | 4 ++-- pkg/webhooks/server.go | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/pkg/policystore/policystore.go b/pkg/policystore/policystore.go index 925fc51238..86e04cbab4 100644 --- a/pkg/policystore/policystore.go +++ b/pkg/policystore/policystore.go @@ -38,7 +38,7 @@ type UpdateInterface interface { type LookupInterface interface { // Lookup based on kind and namespaces LookUp(kind, namespace string) ([]kyverno.ClusterPolicy, error) - GetAll() ([]kyverno.ClusterPolicy, error) + ListAll() ([]kyverno.ClusterPolicy, error) } // NewPolicyStore returns a new policy store @@ -99,7 +99,7 @@ func (ps *PolicyStore) LookUp(kind, namespace string) ([]kyverno.ClusterPolicy, return ret, nil } -func (ps *PolicyStore) GetAll() ([]kyverno.ClusterPolicy, error) { +func (ps *PolicyStore) ListAll() ([]kyverno.ClusterPolicy, error) { policyPointers, err := ps.pLister.List(labels.NewSelector()) if err != nil { return nil, err diff --git a/pkg/webhooks/server.go b/pkg/webhooks/server.go index 8f145cf79b..367fd3219e 100644 --- a/pkg/webhooks/server.go +++ b/pkg/webhooks/server.go @@ -190,7 +190,7 @@ func (ws *WebhookServer) serve(w http.ResponseWriter, r *http.Request) { } func (ws *WebhookServer) handleAdmissionRequest(request *v1beta1.AdmissionRequest) *v1beta1.AdmissionResponse { - policies, err := ws.pMetaStore.GetAll() + policies, err := ws.pMetaStore.ListAll() if err != nil { // Unable to connect to policy Lister to access policies glog.Errorf("Unable to connect to policy controller to access policies. Policies are NOT being applied: %v", err)