1
0
Fork 0
mirror of https://github.com/kyverno/kyverno.git synced 2025-03-31 03:45:17 +00:00

658 refactoring getall lookup name

This commit is contained in:
shravan 2020-02-05 16:29:37 +05:30
parent d38bf5c16e
commit 12c2909d27
2 changed files with 3 additions and 3 deletions

View file

@ -38,7 +38,7 @@ type UpdateInterface interface {
type LookupInterface interface { type LookupInterface interface {
// Lookup based on kind and namespaces // Lookup based on kind and namespaces
LookUp(kind, namespace string) ([]kyverno.ClusterPolicy, error) LookUp(kind, namespace string) ([]kyverno.ClusterPolicy, error)
GetAll() ([]kyverno.ClusterPolicy, error) ListAll() ([]kyverno.ClusterPolicy, error)
} }
// NewPolicyStore returns a new policy store // NewPolicyStore returns a new policy store
@ -99,7 +99,7 @@ func (ps *PolicyStore) LookUp(kind, namespace string) ([]kyverno.ClusterPolicy,
return ret, nil return ret, nil
} }
func (ps *PolicyStore) GetAll() ([]kyverno.ClusterPolicy, error) { func (ps *PolicyStore) ListAll() ([]kyverno.ClusterPolicy, error) {
policyPointers, err := ps.pLister.List(labels.NewSelector()) policyPointers, err := ps.pLister.List(labels.NewSelector())
if err != nil { if err != nil {
return nil, err return nil, err

View file

@ -190,7 +190,7 @@ func (ws *WebhookServer) serve(w http.ResponseWriter, r *http.Request) {
} }
func (ws *WebhookServer) handleAdmissionRequest(request *v1beta1.AdmissionRequest) *v1beta1.AdmissionResponse { func (ws *WebhookServer) handleAdmissionRequest(request *v1beta1.AdmissionRequest) *v1beta1.AdmissionResponse {
policies, err := ws.pMetaStore.GetAll() policies, err := ws.pMetaStore.ListAll()
if err != nil { if err != nil {
// Unable to connect to policy Lister to access policies // 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) glog.Errorf("Unable to connect to policy controller to access policies. Policies are NOT being applied: %v", err)