listwatch

package
v0.37.0 Latest Latest
Warning

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

Go to latest
Published: Mar 2, 2020 License: Apache-2.0 Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func IsAllNamespaces

func IsAllNamespaces(namespaces []string) bool

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

func MultiNamespaceListerWatcher

func MultiNamespaceListerWatcher(l log.Logger, allowedNamespaces, deniedNamespaces []string, f func(string) cache.ListerWatcher) cache.ListerWatcher

MultiNamespaceListerWatcher takes allowed and denied namespaces and a cache.ListerWatcher generator func and returns a single cache.ListerWatcher capable of operating on multiple namespaces.

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 NewFilteredUnprivilegedNamespaceListWatchFromClient

func NewFilteredUnprivilegedNamespaceListWatchFromClient(l log.Logger, c cache.Getter, allowedNamespaces, deniedNamespaces []string, optionsModifier func(options *metav1.ListOptions)) cache.ListerWatcher

NewFilteredUnprivilegedNamespaceListWatchFromClient mimics cache.NewUnprivilegedNamespaceListWatchFromClient. It allows for the creation of a cache.ListWatch for allowed or denied namespaces from a client that does not have `List` privileges.

If the given allowed namespaces contain only v1.NamespaceAll, then this function 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 given allowed 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 NewUnprivilegedNamespaceListWatchFromClient

func NewUnprivilegedNamespaceListWatchFromClient(l log.Logger, c cache.Getter, allowedNamespaces, deniedNamespaces []string, fieldSelector fields.Selector) cache.ListerWatcher

NewUnprivilegedNamespaceListWatchFromClient 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. See NewFilteredUnprivilegedNamespaceListWatchFromClient for a description on how they are applied.

Types

This section is empty.

Jump to

Keyboard shortcuts

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