mirror of
https://github.com/projectcapsule/capsule.git
synced 2026-08-19 12:36:39 +00:00
issues/115. fix endpoint creation for services with selectors when servicesMetadata is specified for tenant (#116)
apply review notes Co-authored-by: Maksim Fedotov <m_fedotov@wargaming.net>
This commit is contained in:
co-authored by
Maksim Fedotov
parent
39d6638669
commit
7ae1c0ae32
@@ -47,8 +47,13 @@ type Endpoints struct {
|
||||
*corev1.Endpoints
|
||||
}
|
||||
|
||||
func (ep Endpoints) Namespace() string {
|
||||
return ep.GetNamespace()
|
||||
func (ep Endpoints) Namespace() (namespace string) {
|
||||
namespace = ep.GetNamespace()
|
||||
// For ep, which are created automatically using service selector namespace will always be empty, so we had to take it from TargetRef
|
||||
if len(namespace) == 0 {
|
||||
namespace = ep.Subsets[0].Addresses[0].TargetRef.Namespace
|
||||
}
|
||||
return
|
||||
}
|
||||
|
||||
func (ep Endpoints) Labels() map[string]string {
|
||||
|
||||
Reference in New Issue
Block a user