Skip to content
Merged
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: 7 additions & 5 deletions internal/cmd/egctl/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -37,9 +37,8 @@ var (
)

const (
adminPort = 19000 // TODO: make this configurable until EG support
rateLimitDebugPort = 6070 // TODO: make this configurable until EG support
containerName = "envoy" // TODO: make this configurable until EG support
adminPort = 19000 // TODO: make this configurable until EG support
rateLimitDebugPort = 6070 // TODO: make this configurable until EG support
)

type aggregatedConfigDump map[string]map[string]protoreflect.ProtoMessage
Expand Down Expand Up @@ -67,7 +66,8 @@ func retrieveConfigDump(args []string, includeEds bool, configType envoyConfigTy
return nil, err
}

podConfigDumps := make(aggregatedConfigDump, 0)
podConfigDumps := make(aggregatedConfigDump)
mu := sync.Mutex{}
// Initialize the map with namespaces
for _, pod := range pods {
if _, ok := podConfigDumps[pod.Namespace]; !ok {
Expand Down Expand Up @@ -99,7 +99,9 @@ func retrieveConfigDump(args []string, includeEds bool, configType envoyConfigTy
return
}

mu.Lock()
podConfigDumps[pod.Namespace][pod.Name] = configDump
mu.Unlock()
}()
}

Expand Down Expand Up @@ -167,7 +169,7 @@ func fetchRunningEnvoyPods(c kube.CLIClient, nn types.NamespacedName, labelSelec
pods = podList.Items
}

podsNamespacedNames := []types.NamespacedName{}
podsNamespacedNames := make([]types.NamespacedName, 0, len(pods))
for _, pod := range pods {
podNsName := utils.NamespacedName(&pod)
if pod.Status.Phase != "Running" {
Expand Down
Loading