From c4ef98240db9f142743f7f9a55744d4e60967db2 Mon Sep 17 00:00:00 2001 From: Manuel de Brito Fontes Date: Sun, 16 Apr 2017 15:48:12 -0300 Subject: [PATCH] Status leader election must consired the ingress class --- core/pkg/ingress/status/status.go | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/core/pkg/ingress/status/status.go b/core/pkg/ingress/status/status.go index 704acf5a8..14ecd9cbe 100644 --- a/core/pkg/ingress/status/status.go +++ b/core/pkg/ingress/status/status.go @@ -17,6 +17,7 @@ limitations under the License. package status import ( + "fmt" "net" "sort" "sync" @@ -187,7 +188,14 @@ func NewStatusSyncer(config Config) Sync { } st.syncQueue = task.NewCustomTaskQueue(st.sync, st.keyfunc) - le, err := NewElection(config.ElectionID, + // we need to use the defined ingress class to allow multiple leaders + // in order to update information about ingress status + id := fmt.Sprintf("%v-%v", config.ElectionID, config.DefaultIngressClass) + if config.IngressClass != "" { + id = fmt.Sprintf("%v-%v", config.ElectionID, config.IngressClass) + } + + le, err := NewElection(id, pod.Name, pod.Namespace, 30*time.Second, st.callback, config.Client) if err != nil {