Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix issue where API gateways were being mis-labeled as Sidecar proxies #1403

Merged
merged 1 commit into from
Aug 10, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 10 additions & 2 deletions cli/cmd/proxy/list/command.go
Original file line number Diff line number Diff line change
Expand Up @@ -204,16 +204,24 @@ func (c *ListCommand) output(pods []v1.Pod) {

for _, pod := range pods {
var proxyType string

// Get the type for ingress, mesh, and terminating gateways.
switch pod.Labels["component"] {
case "ingress-gateway":
proxyType = "Ingress Gateway"
case "mesh-gateway":
proxyType = "Mesh Gateway"
case "terminating-gateway":
proxyType = "Terminating Gateway"
case "api-gateway":
}

// Determine if the pod is an API Gateway.
if pod.Labels["api-gateway.consul.hashicorp.com/managed"] == "true" {
proxyType = "API Gateway"
default:
}

// Fallback to "Sidecar" as a default
if proxyType == "" {
proxyType = "Sidecar"
}

Expand Down
2 changes: 1 addition & 1 deletion cli/cmd/proxy/list/command_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -225,7 +225,7 @@ func TestListCommandOutput(t *testing.T) {
"consul.*mesh-gateway.*Mesh Gateway",
"consul.*terminating-gateway.*Terminating Gateway",
"default.*ingress-gateway.*Ingress Gateway",
"consul.*api-gateway.*Sidecar",
"consul.*api-gateway.*API Gateway",
"default.*pod1.*Sidecar",
}
notExpected := []string{
Expand Down