Documentation ¶
Index ¶
- func AllNamespaces(watchNamespaces []string) bool
- func GetPodNamespace() string
- func NewKubeNamespaceClient(ctx context.Context) (kubernetes.KubeNamespaceClient, error)
- func ProcessWatchNamespaces(watchNamespaces []string, writeNamespace string) []string
- type NoOpKubeNamespaceWatcher
- func (f *NoOpKubeNamespaceWatcher) BaseClient() clients.ResourceClient
- func (f *NoOpKubeNamespaceWatcher) Delete(name string, opts clients.DeleteOpts) error
- func (f *NoOpKubeNamespaceWatcher) List(opts clients.ListOpts) (skkube.KubeNamespaceList, error)
- func (f *NoOpKubeNamespaceWatcher) Read(name string, opts clients.ReadOpts) (*skkube.KubeNamespace, error)
- func (f *NoOpKubeNamespaceWatcher) Register() error
- func (f *NoOpKubeNamespaceWatcher) Watch(opts clients.WatchOpts) (<-chan skkube.KubeNamespaceList, <-chan error, error)
- func (f *NoOpKubeNamespaceWatcher) Write(resource *skkube.KubeNamespace, opts clients.WriteOpts) (*skkube.KubeNamespace, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AllNamespaces ¶
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 ¶
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 (f *NoOpKubeNamespaceWatcher) BaseClient() clients.ResourceClient
func (*NoOpKubeNamespaceWatcher) Delete ¶
func (f *NoOpKubeNamespaceWatcher) Delete(name string, opts clients.DeleteOpts) error
func (*NoOpKubeNamespaceWatcher) List ¶
func (f *NoOpKubeNamespaceWatcher) List(opts clients.ListOpts) (skkube.KubeNamespaceList, error)
func (*NoOpKubeNamespaceWatcher) Read ¶
func (f *NoOpKubeNamespaceWatcher) Read(name string, opts clients.ReadOpts) (*skkube.KubeNamespace, error)
func (*NoOpKubeNamespaceWatcher) Register ¶
func (f *NoOpKubeNamespaceWatcher) Register() error
func (*NoOpKubeNamespaceWatcher) Watch ¶
func (f *NoOpKubeNamespaceWatcher) Watch(opts clients.WatchOpts) (<-chan skkube.KubeNamespaceList, <-chan error, error)
func (*NoOpKubeNamespaceWatcher) Write ¶
func (f *NoOpKubeNamespaceWatcher) Write(resource *skkube.KubeNamespace, opts clients.WriteOpts) (*skkube.KubeNamespace, error)