From 15300b873a55af865b26b64141ef6d39c1c026e0 Mon Sep 17 00:00:00 2001 From: Daniel Nephin Date: Mon, 12 Jul 2021 12:36:36 -0400 Subject: [PATCH] fix backwards compat for envoy command The compatv2 integration tests were failing because they use an older CLI version with a newer HTTP API. This commit restores the GRPCPort field to the DebugConfig output to allow older CIs to continue to fetch the port. --- .changelog/10588.txt | 4 ++++ agent/agent_endpoint.go | 7 ++++++- 2 files changed, 10 insertions(+), 1 deletion(-) create mode 100644 .changelog/10588.txt diff --git a/.changelog/10588.txt b/.changelog/10588.txt new file mode 100644 index 000000000..20ed86e71 --- /dev/null +++ b/.changelog/10588.txt @@ -0,0 +1,4 @@ +```release-note:deprecation +config: the `ports.grpc` and `addresses.grpc` configuration settings have been renamed to `ports.xds` and `addresses.xds` to better match their function. +``` + diff --git a/agent/agent_endpoint.go b/agent/agent_endpoint.go index 7b06875d7..37126761d 100644 --- a/agent/agent_endpoint.go +++ b/agent/agent_endpoint.go @@ -93,9 +93,14 @@ func (s *HTTPHandlers) AgentSelf(resp http.ResponseWriter, req *http.Request) (i Server: s.agent.config.ServerMode, Version: s.agent.config.Version, } + debugConfig := s.agent.config.Sanitized() + // Backwards compat for the envoy command. Never use DebugConfig for + // programmatic access to data. + debugConfig["GRPCPort"] = s.agent.config.XDSPort + return Self{ Config: config, - DebugConfig: s.agent.config.Sanitized(), + DebugConfig: debugConfig, Coord: cs[s.agent.config.SegmentName], Member: s.agent.LocalMember(), Stats: s.agent.Stats(),