listwatch

package
v0.73.2 Latest Latest
Warning

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

Go to latest
Published: Apr 19, 2024 License: Apache-2.0 Imports: 22 Imported by: 0

Documentation

Index

Constants

View Source
const (
	IncludeFilterType = "Include"
	ExcludeFilterType = "Exclude"
)

Variables

This section is empty.

Functions

func DenyTweak added in v0.42.0

func DenyTweak(options *metav1.ListOptions, field string, valueSet map[string]struct{})

DenyTweak modifies the given list options by adding a field selector *not* matching the given values.

func IdenticalNamespaces added in v0.42.0

func IdenticalNamespaces(a, b map[string]struct{}) bool

IdenticalNamespaces returns true if a and b are identical.

func IsAllNamespaces

func IsAllNamespaces(namespaces map[string]struct{}) bool

IsAllNamespaces checks if the given map of namespaces contains only v1.NamespaceAll.

func NewNamespaceListWatchFromClient added in v0.69.1

func NewNamespaceListWatchFromClient(
	ctx context.Context,
	l log.Logger,
	k8sVersion version.Info,
	corev1Client corev1.CoreV1Interface,
	ssarClient authv1.SelfSubjectAccessReviewInterface,
	allowedNamespaces, deniedNamespaces map[string]struct{},
) (cache.ListerWatcher, bool, error)

NewNamespaceListWatchFromClient mimics cache.NewListWatchFromClient. It allows for the creation of a cache.ListWatch for namespaces from a client that does not have `List` privileges. If the slice of namespaces contains only v1.NamespaceAll, then this func assumes that the client has List and Watch privileges and returns a regular cache.ListWatch, since there is no other way to get all namespaces.

The allowed namespaces and denied namespaces are mutually exclusive.

If allowed namespaces contain multiple items, the given denied namespaces have no effect.

If the allowed namespaces includes exactly one entry with the value v1.NamespaceAll (empty string), the given denied namespaces are applied.

func TweakByLabel added in v0.69.1

func TweakByLabel(options *metav1.ListOptions, label string, filter FilterType, valueSet map[string]struct{})

TweakByLabel modifies the given list options by adding a label selector matching/excluding the given values.

Types

type FilterType added in v0.69.1

type FilterType string

Jump to

Keyboard shortcuts

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