kubernetes: Improve namespace usage (#4767)

* Use GetByKey instead of List in GetNamespaceByName.
* Add ToNamespace to reduce memory for namespace cache.

Signed-off-by: Mat Lowery <mlowery@ebay.com>
This commit is contained in:
Mat Lowery 2021-07-29 21:27:25 -06:00 committed by GitHub
parent 8ff7c4b834
commit 9d5b8cd13d
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
9 changed files with 100 additions and 47 deletions

View file

@ -253,11 +253,9 @@ func (APIConnServiceTest) GetNodeByName(ctx context.Context, name string) (*api.
}, nil
}
func (APIConnServiceTest) GetNamespaceByName(name string) (*api.Namespace, error) {
return &api.Namespace{
ObjectMeta: meta.ObjectMeta{
Name: name,
},
func (APIConnServiceTest) GetNamespaceByName(name string) (*object.Namespace, error) {
return &object.Namespace{
Name: name,
}, nil
}