namespace

package
v1.15.0-rc.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jul 17, 2025 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Matcher

type Matcher struct {
	Namespace runtime.Object
}

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

func (*Matcher) GetNamespace

func (m *Matcher) GetNamespace(name string) (metav1.Object, error)

func (*Matcher) GetNamespaceLabels

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

func (m *Matcher) MatchNamespaceSelector(p NamespaceSelectorProvider, 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

func (m *Matcher) Validate() error

Validate checks if the Matcher has a NamespaceLister and Client.

type NamespaceSelectorProvider

type NamespaceSelectorProvider interface {
	// GetNamespaceSelector gets the webhook NamespaceSelector field.
	GetParsedNamespaceSelector() (labels.Selector, error)
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL