Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Non Watched Namespace Labeled selectors #515

Open
wants to merge 106 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 46 commits
Commits
Show all changes
106 commits
Select commit Hold shift + click to select a range
c3c1bfa
initial commit before code generation
jackstine Aug 17, 2022
9d2a486
solving generator problems
jackstine Aug 18, 2022
a8a66dd
updated the snahost emitter template, it now generates code.
jackstine Aug 18, 2022
ed99470
comment with added
jackstine Aug 18, 2022
acebcb8
update to testing snapshot emitter
jackstine Aug 18, 2022
c466f4d
added code for testing snapshot emitter
jackstine Aug 22, 2022
0f6b483
updated so that ClusterScoped resource snapshot emitters will work
jackstine Aug 22, 2022
16b5232
update the snapshot_emitter to call out to kube for the namespaces
jackstine Aug 22, 2022
e64c8f1
updates to testing and snapshot emitter
jackstine Aug 23, 2022
670cf7e
update for interface for ResourceNamespaces
jackstine Aug 25, 2022
95d8548
updated snapshot_emitter to filter namespaces by labels, and not reso…
jackstine Aug 25, 2022
86bca00
added client interface
jackstine Aug 25, 2022
90b86d2
left out some things
jackstine Aug 25, 2022
26216b5
get interface to work with expression selectors
jackstine Aug 25, 2022
0ef7be9
Merge refs/heads/master into labeled-selectors
soloio-bulldozer[bot] Aug 26, 2022
c829254
got it passing tests for namespaced labels
jackstine Aug 26, 2022
afc7fd2
Merge branch 'labeled-selectors' of ssh://github.com/solo-io/solo-kit…
jackstine Aug 26, 2022
b2ce0cf
snapshot does not contain deleted namespace resources
jackstine Aug 26, 2022
4cf797d
pass CI for non ClusterScoped
jackstine Aug 26, 2022
765bfc5
adding kube client resource namespace lister
jackstine Aug 29, 2022
36bccb7
added in map for watched namespaces
jackstine Aug 29, 2022
af6eb5d
updated snapshot emitter, delt with err channels and with deleting na…
jackstine Aug 30, 2022
644a6f9
clean up and reviews
jackstine Aug 30, 2022
4c4192f
add missing file generated
jackstine Aug 30, 2022
5c53707
change variable name
jackstine Aug 30, 2022
ac6124f
update with comments, and nits
jackstine Aug 30, 2022
3f60056
moving some functions
jackstine Aug 30, 2022
24ded9e
small change
jackstine Aug 30, 2022
8bd5ec5
closing the channels
jackstine Aug 30, 2022
2a9cf1c
updated the tests
jackstine Aug 30, 2022
20770ed
fix kube event loop error
jackstine Aug 30, 2022
835b2f9
update changelog
jackstine Aug 30, 2022
4c86983
to pass CI retro 1
jackstine Aug 30, 2022
62de6b8
fix
jackstine Aug 31, 2022
0d847d1
fix
jackstine Aug 31, 2022
feb1c79
race conditions, still working on fixing issues with deleted namespaces
jackstine Aug 31, 2022
c2377cf
fix issue with non Expression Selector emitters updating when namespa…
jackstine Sep 1, 2022
b806cfc
update fix problem with namespaces getting terminated, but not deleted
jackstine Sep 1, 2022
8587388
refactored the test code, to make it more easier to manage
jackstine Sep 1, 2022
148dc61
missing build solokit
jackstine Sep 1, 2022
576f2aa
fix issue with name5
jackstine Sep 1, 2022
1a0989a
fix name5
jackstine Sep 1, 2022
3aa046c
v1 alpha
jackstine Sep 1, 2022
f09e7e6
fix problems with parallel tests
jackstine Sep 1, 2022
217108b
update to fix notifications about snapshots
jackstine Sep 1, 2022
a1fb027
missing file updates
jackstine Sep 1, 2022
f1db36e
add updated go build comments
jackstine Sep 1, 2022
f6d374f
Merge ssh://github.com/solo-io/solo-kit into labeledSelectors
jackstine Sep 9, 2022
9aafe60
updated the controller to allow adding informers
jackstine Sep 11, 2022
e7371ca
register new namespace to cache
jackstine Sep 12, 2022
d3c5196
register new namespaces for the Resoruce Client Shared Informer Factory
jackstine Sep 12, 2022
ce03b28
Merge branch 'cache-changes' into labeled-selectors
jackstine Sep 12, 2022
1ae4371
added in Register Namespace to the Resouce client interface.
jackstine Sep 12, 2022
5e9f466
update resource clients
jackstine Sep 13, 2022
b72998b
Merge refs/heads/master into labeled-selectors
soloio-bulldozer[bot] Sep 13, 2022
cb7159b
add rc template
jackstine Sep 13, 2022
e2b5868
Merge branch 'labeled-selectors' of ssh://github.com/solo-io/solo-kit…
jackstine Sep 13, 2022
d05edec
add in once functionality to register calls
jackstine Sep 13, 2022
0e2db70
rcf must start() if we are registering namespaces to it
jackstine Sep 13, 2022
2ad5399
possible race condition fix
jackstine Sep 13, 2022
e9c3539
fix registering issue
jackstine Sep 13, 2022
7af3b64
fix reconciler
jackstine Sep 13, 2022
7b1e280
change test so that the kube cache does not panic
jackstine Sep 13, 2022
b334e28
update the client interface
jackstine Sep 13, 2022
f3597e0
better mutex control
jackstine Sep 13, 2022
6988153
fix race condition in test
jackstine Sep 13, 2022
0641785
add comment
jackstine Sep 13, 2022
2f06f41
allow new namespaces in the kube resouce client
jackstine Sep 13, 2022
57873d6
clean up
jackstine Sep 13, 2022
b9cbb91
added in a test for when namespaces are deleted
jackstine Sep 13, 2022
8bb2c03
fix cache test
jackstine Sep 13, 2022
c074097
fix cache test again
jackstine Sep 13, 2022
f3aa04a
Adding changelog file to new location
Sep 14, 2022
ea8b754
Deleting changelog file from old location
Sep 14, 2022
9894a78
Merge branch 'master' into labeled-selectors
jackstine Sep 15, 2022
39072d5
fix merge conflict issue
jackstine Sep 15, 2022
50578c7
finish todos, add logs for registered namespaces, fixed issue with Re…
jackstine Sep 16, 2022
7b30788
update tests
jackstine Sep 16, 2022
24c3941
fixed issue with test, and cleaned up tests a little
jackstine Sep 19, 2022
93642d1
fix error with kube emitter
jackstine Sep 19, 2022
a047e22
Adding changelog file to new location
Sep 21, 2022
2353077
Deleting changelog file from old location
Sep 21, 2022
f8e908c
Kube Cache now requires a boolean for creating the namespace lister
jackstine Sep 21, 2022
ed44661
Merge branch 'labeled-selectors' of ssh://github.com/solo-io/solo-kit…
jackstine Sep 21, 2022
57e4976
Merge branch 'master' into labeled-selectors
jackstine Sep 21, 2022
8d91464
update to fix merge conflict
jackstine Sep 21, 2022
4c7db7f
when namespaces is set to "" then create the namespace lister
jackstine Sep 21, 2022
1c1fa6c
condition on namespace lister
jackstine Sep 21, 2022
66ddd96
delete failing mock_custom spec hash resource
jackstine Sep 22, 2022
eee5ed2
some touch ups. Errors are now logged in the list and watch functions…
jackstine Sep 22, 2022
53176bf
move changelog
jackstine Sep 22, 2022
b6afc93
Merge refs/heads/master into labeled-selectors
soloio-bulldozer[bot] Sep 28, 2022
548a0c9
Merge refs/heads/master into labeled-selectors
soloio-bulldozer[bot] Sep 29, 2022
d2f6b4d
Merge refs/heads/master into labeled-selectors
soloio-bulldozer[bot] Sep 29, 2022
c3b1510
Adding changelog file to new location
Feb 13, 2023
879f457
Deleting changelog file from old location
Feb 13, 2023
3e2718b
Adding changelog file to new location
May 19, 2023
26bac9d
Deleting changelog file from old location
May 19, 2023
e6f69d4
Adding changelog file to new location
Jul 21, 2023
c0ea174
Deleting changelog file from old location
Jul 21, 2023
f8db291
Adding changelog file to new location
Dec 5, 2023
ebcbbd9
Deleting changelog file from old location
Dec 5, 2023
9f7df5e
Adding changelog file to new location
May 28, 2024
5100636
Deleting changelog file from old location
May 28, 2024
9f20d56
Adding changelog file to new location
Sep 11, 2024
b560d27
Deleting changelog file from old location
Sep 11, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
# solo-kit
A collection of code generation and libraries to for API development.

### Testing
To generate tests set `SkipGeneratedTests` to false in the `generate.go` file. This will use the test templates
to generate the code for the tests. Such as files like `pkg/code-generator/codegen/templates/snapshot_emitter_test_template.go`

### Description:
- Define your declarative API in `.proto` files
- APIs are defined by top-level protobuf messages in `.proto` files
Expand Down
9 changes: 9 additions & 0 deletions changelog/v0.30.3/namespace-selectors.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
changelog:
- type: NEW_FEATURE
issueLink: https://github.com/solo-io/gloo/issues/5868
description: |
Added the ability to watch namespaces given be Expression Selectors in the Watch Opts
Watched Namespaces work as normally. When Expression Selectors the snapshot
emitter will watch, in addition to the watched namespaces, namespaces that
are labeled and meet the criteria of the Expression Selector. All resource
clients will watch these namespaces, if set.
7 changes: 5 additions & 2 deletions pkg/api/external/kubernetes/namespace/resource_client.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@ import (
kubev1 "k8s.io/api/core/v1"
apierrors "k8s.io/apimachinery/pkg/api/errors"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
"k8s.io/apimachinery/pkg/labels"
"k8s.io/client-go/kubernetes"
)

Expand Down Expand Up @@ -144,7 +143,11 @@ func (rc *namespaceResourceClient) List(namespace string, opts clients.ListOpts)
return nil, eris.New("to list namespaces you must watch all namespaces")
}

namespaceObjList, err := rc.cache.NamespaceLister().List(labels.SelectorFromSet(opts.Selector))
listOptions, err := clients.GetLabelSelector(opts)
if err != nil {
return nil, err
}
namespaceObjList, err := rc.cache.NamespaceLister().List(listOptions)
if err != nil {
return nil, eris.Wrapf(err, "listing namespaces level")
}
Expand Down
183 changes: 183 additions & 0 deletions pkg/api/external/kubernetes/namespace/resource_namespace.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,183 @@
package namespace

import (
"bytes"

"github.com/pkg/errors"
"github.com/solo-io/solo-kit/pkg/api/v1/clients"
"github.com/solo-io/solo-kit/pkg/api/v1/clients/kube/cache"
"github.com/solo-io/solo-kit/pkg/api/v1/resources"
skkube "github.com/solo-io/solo-kit/pkg/api/v1/resources/common/kubernetes"
kubev1 "k8s.io/api/core/v1"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
kubewatch "k8s.io/apimachinery/pkg/watch"
"k8s.io/client-go/kubernetes"
)

var _ resources.ResourceNamespaceLister = &kubeResourceNamespaceLister{}
var _ resources.ResourceNamespaceLister = &kubeClientResourceNamespaceLister{}

// NewKubeClientCacheResourceNamespaceLister will create a new resource namespace lister that requires the kubernestes
// client and cache.
func NewKubeClientCacheResourceNamespaceLister(kube kubernetes.Interface, cache cache.KubeCoreCache) resources.ResourceNamespaceLister {
return &kubeResourceNamespaceLister{
client: NewNamespaceClient(kube, cache),
}
}

// NewKubeClientResourceNamespaceLister will create a new resource namespace lister that requires the kubernetes client
// interface.
func NewKubeClientResourceNamespaceLister(kube kubernetes.Interface) resources.ResourceNamespaceLister {
return &kubeClientResourceNamespaceLister{
kube: kube,
}
}
jackstine marked this conversation as resolved.
Show resolved Hide resolved

type kubeResourceNamespaceLister struct {
client skkube.KubeNamespaceClient
}

// GetResourceNamespaceList is the kubernetes implementation that returns the list of namespaces
func (kns *kubeResourceNamespaceLister) GetResourceNamespaceList(opts resources.ResourceNamespaceListOptions, filtered resources.ResourceNamespaceList) (resources.ResourceNamespaceList, error) {
namespaces, err := kns.client.List(clients.TranslateResourceNamespaceListToListOptions(opts))
if err != nil {
return nil, err
}
converted := convertNamespaceListToResourceNamespace(namespaces)
return kns.filter(converted, filtered), nil
}

// GetResourceNamespaceWatch returns a watch for events that occur on kube namespaces returning a list of all the namespaces
func (kns *kubeResourceNamespaceLister) GetResourceNamespaceWatch(opts resources.ResourceNamespaceWatchOptions, filtered resources.ResourceNamespaceList) (chan resources.ResourceNamespaceList, <-chan error, error) {
ctx := opts.Ctx
wopts := clients.TranslateResourceNamespaceListToWatchOptions(opts)
namespaceChan, errorChan, err := kns.client.Watch(wopts)
if err != nil {
return nil, nil, err
}

resourceNamespaceChan := make(chan resources.ResourceNamespaceList)
go func() {
defer close(resourceNamespaceChan)
for {
select {
case namespaceList := <-namespaceChan:
select {
case resourceNamespaceChan <- kns.filter(convertNamespaceListToResourceNamespace(namespaceList), filtered):
case <-ctx.Done():
return
}
case <-ctx.Done():
return
}
}
}()
return resourceNamespaceChan, errorChan, nil
}

func (kns *kubeResourceNamespaceLister) filter(namespaces resources.ResourceNamespaceList, filter resources.ResourceNamespaceList) resources.ResourceNamespaceList {
filteredList := resources.ResourceNamespaceList{}
for _, ns := range namespaces {
add := true
for _, wns := range filter {
if ns.Name == wns.Name {
add = false
break
}
}
if add {
filteredList = append(filteredList, ns)
}
}
return filteredList
}

func convertNamespaceListToResourceNamespace(namespaces skkube.KubeNamespaceList) resources.ResourceNamespaceList {
l := make(resources.ResourceNamespaceList, len(namespaces))
for i, ns := range namespaces {
l[i] = resources.ResourceNamespace{Name: ns.ObjectMeta.Name}
}
return l
}

type kubeClientResourceNamespaceLister struct {
kube kubernetes.Interface
}

// GetResourceNamespaceList is the kubernetes implementation that returns the list of namespaces
func (client *kubeClientResourceNamespaceLister) GetResourceNamespaceList(opts resources.ResourceNamespaceListOptions, filtered resources.ResourceNamespaceList) (resources.ResourceNamespaceList, error) {
excludeNamespaces := client.getExcludeFieldSelector(filtered)
namespaceList, err := client.kube.CoreV1().Namespaces().List(opts.Ctx, metav1.ListOptions{FieldSelector: excludeNamespaces, LabelSelector: opts.ExpressionSelector})
if err != nil {
return nil, err
}
return convertNamespaceListToResourceNamespaceList(namespaceList), nil
}

// GetResourceNamespaceWatch returns a watch for events that occur on kube namespaces returning a list of all the namespaces
func (client *kubeClientResourceNamespaceLister) GetResourceNamespaceWatch(opts resources.ResourceNamespaceWatchOptions, filtered resources.ResourceNamespaceList) (chan resources.ResourceNamespaceList, <-chan error, error) {
excludeNamespaces := client.getExcludeFieldSelector(filtered)
namespaceWatcher, err := client.kube.CoreV1().Namespaces().Watch(opts.Ctx, metav1.ListOptions{FieldSelector: excludeNamespaces, LabelSelector: opts.ExpressionSelector})
if err != nil {
return nil, nil, err
}
namespaceChan := namespaceWatcher.ResultChan()
resourceNamespaceChan := make(chan resources.ResourceNamespaceList)
errorChannel := make(chan error)
go func() {
defer func() {
close(resourceNamespaceChan)
close(errorChannel)
}()
Comment on lines +128 to +131
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Closing the channels here when an error occurs.

for {
select {
case <-opts.Ctx.Done():
return
case event, ok := <-namespaceChan:
if !ok {
return
}
switch event.Type {
case kubewatch.Error:
errorChannel <- errors.Errorf("error with the event from watching namespaces: %v", event)
return
default:
resourceNamespaceList, err := client.GetResourceNamespaceList(resources.ResourceNamespaceListOptions{
Ctx: opts.Ctx,
ExpressionSelector: opts.ExpressionSelector,
}, filtered)
if err != nil {
errorChannel <- errors.Wrap(err, "error getting the list of resource namespaces while watching")
return
}
resourceNamespaceChan <- resourceNamespaceList
}
}
}
}()
return resourceNamespaceChan, errorChannel, nil
}

func (client *kubeClientResourceNamespaceLister) getExcludeFieldSelector(filtered resources.ResourceNamespaceList) string {
var buffer bytes.Buffer
for i, rns := range filtered {
ns := rns.Name
if ns != "" {
buffer.WriteString("metadata.name!=")
buffer.WriteString(ns)
if i < len(filtered)-1 {
buffer.WriteByte(',')
}
}
}
return buffer.String()
}

func convertNamespaceListToResourceNamespaceList(namespaceList *kubev1.NamespaceList) resources.ResourceNamespaceList {
resourceNamespaces := make(resources.ResourceNamespaceList, len(namespaceList.Items))
for i, item := range namespaceList.Items {
ns := item.Name
resourceNamespaces[i] = resources.ResourceNamespace{Name: ns}
}
return resourceNamespaces
}
6 changes: 2 additions & 4 deletions pkg/api/v1/clients/common/common.go
Original file line number Diff line number Diff line change
Expand Up @@ -37,10 +37,8 @@ func KubeResourceWatch(cache cache.Cache, listFunc ResourceListFunc, namespace s
// prevent flooding the channel with duplicates
var previous *resources.ResourceList
updateResourceList := func() {
list, err := listFunc(namespace, clients.ListOpts{
Ctx: opts.Ctx,
Selector: opts.Selector,
})
lopts := clients.TranslateWatchOptsIntoListOpts(opts)
list, err := listFunc(namespace, lopts)
if err != nil {
errs <- err
return
Expand Down
13 changes: 1 addition & 12 deletions pkg/api/v1/clients/kube/resource_client.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@ import (
"go.opencensus.io/tag"
apierrors "k8s.io/apimachinery/pkg/api/errors"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
"k8s.io/apimachinery/pkg/labels"
)

var (
Expand Down Expand Up @@ -296,7 +295,7 @@ func (rc *ResourceClient) List(namespace string, opts clients.ListOpts) (resourc
return nil, err
}

labelSelector, err := rc.getLabelSelector(opts)
labelSelector, err := clients.GetLabelSelector(opts)
if err != nil {
return nil, errors.Wrapf(err, "parsing label selector")
}
Expand Down Expand Up @@ -414,16 +413,6 @@ func (rc *ResourceClient) Watch(namespace string, opts clients.WatchOpts) (<-cha
return resourcesChan, errs, nil
}

func (rc *ResourceClient) getLabelSelector(listOpts clients.ListOpts) (labels.Selector, error) {
// https://kubernetes.io/docs/concepts/overview/working-with-objects/labels/#set-based-requirement
if listOpts.ExpressionSelector != "" {
return labels.Parse(listOpts.ExpressionSelector)
}

// https://kubernetes.io/docs/concepts/overview/working-with-objects/labels/#equality-based-requirement
return labels.SelectorFromSet(listOpts.Selector), nil
}

// Checks whether the group version kind of the given resource matches that of the client's underlying CRD:
func (rc *ResourceClient) matchesClientGVK(resource v1.Resource) bool {
return resource.GroupVersionKind().String() == rc.crd.GroupVersionKind().String()
Expand Down
35 changes: 35 additions & 0 deletions pkg/api/v1/clients/options.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
package clients

import (
"github.com/solo-io/solo-kit/pkg/api/v1/resources"
"k8s.io/apimachinery/pkg/labels"
)

// GetLabelSelector will parse ExpresionSelector if present, else it selects Selector.
func GetLabelSelector(listOpts ListOpts) (labels.Selector, error) {
// https://kubernetes.io/docs/concepts/overview/working-with-objects/labels/#set-based-requirement
if listOpts.ExpressionSelector != "" {
return labels.Parse(listOpts.ExpressionSelector)
}

// https://kubernetes.io/docs/concepts/overview/working-with-objects/labels/#equality-based-requirement
return labels.SelectorFromSet(listOpts.Selector), nil
}

// TranslateWatchOptsIntoListOpts translates the watch options into list options
func TranslateWatchOptsIntoListOpts(wopts WatchOpts) ListOpts {
clopts := ListOpts{Ctx: wopts.Ctx, ExpressionSelector: wopts.ExpressionSelector, Selector: wopts.Selector}
return clopts
}

// TranslateResourceNamespaceListToListOptions translates the resource namespace list options to List Options
func TranslateResourceNamespaceListToListOptions(lopts resources.ResourceNamespaceListOptions) ListOpts {
clopts := ListOpts{Ctx: lopts.Ctx, ExpressionSelector: lopts.ExpressionSelector}
return clopts
}

// TranslateResourceNamespaceListToWatchOptions translates the resource namespace watch options to Watch Options
func TranslateResourceNamespaceListToWatchOptions(wopts resources.ResourceNamespaceWatchOptions) WatchOpts {
clopts := WatchOpts{Ctx: wopts.Ctx, ExpressionSelector: wopts.ExpressionSelector}
return clopts
}
57 changes: 57 additions & 0 deletions pkg/api/v1/resources/resource_interface.go
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package resources

import (
"context"
"fmt"
"reflect"
"sort"
Expand Down Expand Up @@ -80,6 +81,62 @@ type CustomInputResource interface {
MarshalStatus() (v1.Status, error)
}

// ResourceNamespaceListOptions provides the options for listing Resource Namespaces
type ResourceNamespaceListOptions struct {
// Ctx is the context
Ctx context.Context

// Equality-based label requirements
// https://kubernetes.io/docs/concepts/overview/working-with-objects/labels/#equality-based-requirement
// Equality-based requirements allow filtering by label keys and values.
// Matching objects must satisfy all of the specified label constraints,
// though they may have additional labels as well.
// Example:
// {product: edge} would return all objects with a label key equal to
// product and label value equal to edge
// If both ExpressionSelector and Selector are defined, ExpressionSelector is preferred
ExpressionSelector string
}

// ResourceNamespaceWatchOptions provides the options for watching Resource Namespaces
type ResourceNamespaceWatchOptions struct {
// Ctx is the context
Ctx context.Context
// Equality-based label requirements
// https://kubernetes.io/docs/concepts/overview/working-with-objects/labels/#equality-based-requirement
// Equality-based requirements allow filtering by label keys and values.
// Matching objects must satisfy all of the specified label constraints,
// though they may have additional labels as well.
// Example:
// {product: edge} would return all objects with a label key equal to
// product and label value equal to edge
// If both ExpressionSelector and Selector are defined, ExpressionSelector is preferred
ExpressionSelector string
}

// ResoruceNamespace is the namespaces that resources can be found. ResourceNamespaces are
// anything that contains resources independent of other resoruces. They provide sections
// independent infrastructure or regions. IE kubernetes namespaces
type ResourceNamespace struct {
// Name the name of the namespace
Name string
}

// ResourceNamespaceList contains a list of ResourceNamespaces
type ResourceNamespaceList []ResourceNamespace

// ResourceNamespaceLister is anything that can list and watch namespaces that
// resources can be found.
type ResourceNamespaceLister interface {
// GetResourceNamespaceList returns the list of the namespaces that resources
// can be found. The list returned will not contain namespacesToFilter.
GetResourceNamespaceList(opts ResourceNamespaceListOptions, namespacesToFilter ResourceNamespaceList) (ResourceNamespaceList, error)
// GetResourceNamespaceWatch returns a watch that receives events when namespaces
// are updated or created. The channel will not return namespacesToFilter. Use the errs for when
// errors are async.
GetResourceNamespaceWatch(opts ResourceNamespaceWatchOptions, namespacesToFilter ResourceNamespaceList) (chan ResourceNamespaceList, <-chan error, error)
}

type ResourceList []Resource
type ResourcesById map[string]Resource
type ResourcesByKind map[string]ResourceList
Expand Down
Loading