From 6035e55ec342902d98e98ed3c1d2095d4a87b5dc Mon Sep 17 00:00:00 2001 From: Antoine Cotten Date: Sat, 29 Jul 2017 15:27:56 +0200 Subject: [PATCH] Return reference to object providing Endpoint --- core/pkg/ingress/controller/controller.go | 1 + core/pkg/ingress/types.go | 2 ++ core/pkg/ingress/types_equals.go | 3 +++ 3 files changed, 6 insertions(+) diff --git a/core/pkg/ingress/controller/controller.go b/core/pkg/ingress/controller/controller.go index a5e8d6d68..a0527560f 100644 --- a/core/pkg/ingress/controller/controller.go +++ b/core/pkg/ingress/controller/controller.go @@ -1188,6 +1188,7 @@ func (ic *GenericController) getEndpoints( Port: fmt.Sprintf("%v", targetPort), MaxFails: hz.MaxFails, FailTimeout: hz.FailTimeout, + Target: epAddress.TargetRef, } upsServers = append(upsServers, ups) adus[ep] = true diff --git a/core/pkg/ingress/types.go b/core/pkg/ingress/types.go index 5564079e5..785439549 100644 --- a/core/pkg/ingress/types.go +++ b/core/pkg/ingress/types.go @@ -193,6 +193,8 @@ type Endpoint struct { // of unsuccessful attempts to communicate with the server should happen // to consider the endpoint unavailable FailTimeout int `json:"failTimeout"` + // Target returns a reference to the object providing the endpoint + Target *api.ObjectReference `json:"target"` } // Server describes a website diff --git a/core/pkg/ingress/types_equals.go b/core/pkg/ingress/types_equals.go index 6b0a2132c..c0c63d923 100644 --- a/core/pkg/ingress/types_equals.go +++ b/core/pkg/ingress/types_equals.go @@ -258,6 +258,9 @@ func (e1 *Endpoint) Equal(e2 *Endpoint) bool { if e1.FailTimeout != e2.FailTimeout { return false } + if e1.Target != e2.Target { + return false + } return true }