namespaces

package
v1.17.9 Latest Latest
Warning

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

Go to latest
Published: Sep 23, 2024 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AllNamespaces

func AllNamespaces(watchNamespaces []string) bool

AllNamespaces returns true if the list of namespaces watched is empty or contains only a blank string This implies that all namespaces are to be watched

func GetPodNamespace

func GetPodNamespace() string

GetPodNamespace returns the value of the env var `POD_NAMESPACE` and defaults to `gloo-system` if unset

func NewKubeNamespaceClient

func NewKubeNamespaceClient(ctx context.Context) (kubernetes.KubeNamespaceClient, error)

NewKubeNamespaceClient creates and returns the `namespace.NewNamespaceClient` if it has permissions to list namespaces This entails creating a kubeclient, kubecorecache and calling a SelfSubjectAccessReview to verify if it has the appropriate RBAC

func ProcessWatchNamespaces

func ProcessWatchNamespaces(watchNamespaces []string, writeNamespace string) []string

ProcessWatchNamespaces appends the writeNamespace to the list of watchNamespaces passed if not already present and returns it

Types

type NoOpKubeNamespaceWatcher

type NoOpKubeNamespaceWatcher struct{}

NoOpKubeNamespaceWatcher to eliminate the need for this fake client for non kube environments Currently the generated code (event loop, snapshots) expects the KubeNamespaceClient to not be nil and the KubeNamespaceClient does not have checks to ensure it is handled properly if nil so this is the workaround for now until we rewrite the generated code

func (*NoOpKubeNamespaceWatcher) BaseClient

func (*NoOpKubeNamespaceWatcher) Delete

func (f *NoOpKubeNamespaceWatcher) Delete(name string, opts clients.DeleteOpts) error

func (*NoOpKubeNamespaceWatcher) List

func (*NoOpKubeNamespaceWatcher) Read

func (*NoOpKubeNamespaceWatcher) Register

func (f *NoOpKubeNamespaceWatcher) Register() error

func (*NoOpKubeNamespaceWatcher) Watch

func (*NoOpKubeNamespaceWatcher) Write

Jump to

Keyboard shortcuts

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