apiserver: k8s.io/apiserver/pkg/admission/plugin/webhook/namespace Index | Files

package namespace

import "k8s.io/apiserver/pkg/admission/plugin/webhook/namespace"

Package namespace defines the utilities that are used by the webhook plugin to decide if a webhook should be applied to an object based on its namespace.

Index

Package Files

doc.go matcher.go

type Matcher Uses

type Matcher struct {
    NamespaceLister corelisters.NamespaceLister
    Client          clientset.Interface
}

Matcher decides if a request is exempted by the NamespaceSelector of a webhook configuration.

func (*Matcher) GetNamespaceLabels Uses

func (m *Matcher) GetNamespaceLabels(attr admission.Attributes) (map[string]string, error)

GetNamespaceLabels gets the labels of the namespace related to the attr.

func (*Matcher) MatchNamespaceSelector Uses

func (m *Matcher) MatchNamespaceSelector(h webhook.WebhookAccessor, attr admission.Attributes) (bool, *apierrors.StatusError)

MatchNamespaceSelector decideds whether the request matches the namespaceSelctor of the webhook. Only when they match, the webhook is called.

func (*Matcher) Validate Uses

func (m *Matcher) Validate() error

Validate checks if the Matcher has a NamespaceLister and Client.

Package namespace imports 10 packages (graph) and is imported by 2 packages. Updated 2019-10-16. Refresh now. Tools for package owners.