Skip to content

Commit

Permalink
cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
sarahalsmiller committed Jan 8, 2024
1 parent 6764737 commit 15d073b
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 4 deletions.
6 changes: 3 additions & 3 deletions cli/cmd/proxy/list/command.go
Original file line number Diff line number Diff line change
Expand Up @@ -234,15 +234,15 @@ func (c *ListCommand) fetchPods() ([]v1.Pod, error) {
}
if len(apigatewaypods.Items) > 0 {
//Deduplicated pod list
seenPods := map[string]bool{}
seenPods := map[string]struct{}{}
for _, pod := range apigatewaypods.Items {
if seenPods[namespacedName(pod)] {
if _, ok := seenPods[namespacedName(pod)]; ok {
continue
}
found := false
for _, gatewayPod := range gatewaypods.Items {
//note that we already have this pod in the list so we can exit early.
seenPods[namespacedName(gatewayPod)] = true
seenPods[namespacedName(gatewayPod)] = struct{}{}

if (namespacedName(gatewayPod)) == namespacedName(pod) {
found = true
Expand Down
1 change: 0 additions & 1 deletion cli/cmd/proxy/list/command_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -433,7 +433,6 @@ func TestListCommandOutputInJsonFormat(t *testing.T) {
require.Equal(t, 0, out)

actual := buf.String()
fmt.Println(actual)

require.Regexp(t, expected, actual)
for _, expression := range notExpected {
Expand Down

0 comments on commit 15d073b

Please sign in to comment.