From 63cc66ae7bf3997f88333439360117bc73f35bcb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jason=20K=C3=B6lker?= Date: Fri, 21 Aug 2020 16:21:33 +0000 Subject: [PATCH] rest: extract elements instead of matching If the host has old style VIPs, then the matching will fail, instead just extract the first two elements regardless of the length. --- apps/dcos_rest/src/dcos_rest_vips_handler.erl | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/apps/dcos_rest/src/dcos_rest_vips_handler.erl b/apps/dcos_rest/src/dcos_rest_vips_handler.erl index 01953f79..4901abf9 100644 --- a/apps/dcos_rest/src/dcos_rest_vips_handler.erl +++ b/apps/dcos_rest/src/dcos_rest_vips_handler.erl @@ -51,10 +51,10 @@ vip(Protocol, FullName, Port) -> PortBin = integer_to_binary(Port), {<>, Protocol}. -backend({_AgentIP, {IP, Port, _Weight}}) -> +backend({_AgentIP, BE}) -> #{ - ip => ip(IP), - port => Port + ip => ip(element(1, BE)), + port => element(2, BE) }. ip(IP) ->