Skip to content

Commit a2ce000

Browse files
authored
egctl: collect per namespace (#7289)
Signed-off-by: zirain <[email protected]>
1 parent dacf790 commit a2ce000

File tree

1 file changed

+14
-12
lines changed

1 file changed

+14
-12
lines changed

internal/troubleshoot/collect.go

Lines changed: 14 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -86,24 +86,26 @@ func CollectResult(ctx context.Context, restConfig *rest.Config, opts ...Collect
8686
}
8787
}()
8888

89-
collectors := []tbcollect.Collector{
90-
// Collect the custom resources from Gateway API and EG
91-
&collect.CustomResource{
92-
ClientConfig: restConfig,
93-
BundlePath: collectorOpts.bundlePath,
94-
IncludeGroups: []string{
95-
"gateway.envoyproxy.io",
96-
"gateway.networking.k8s.io",
97-
},
98-
},
99-
}
100-
89+
collectors := []tbcollect.Collector{}
10190
bundlePath := collectorOpts.bundlePath
10291
for _, ns := range collectorOpts.namespaces {
10392
collectorList := []struct {
10493
cType CollectorType
10594
collector tbcollect.Collector
10695
}{
96+
{
97+
cType: CollectorTypeEnvoyGatewayResource,
98+
// Collect the custom resources from Gateway API and EG
99+
collector: &collect.CustomResource{
100+
ClientConfig: restConfig,
101+
BundlePath: collectorOpts.bundlePath,
102+
Namespace: ns,
103+
IncludeGroups: []string{
104+
"gateway.envoyproxy.io",
105+
"gateway.networking.k8s.io",
106+
},
107+
},
108+
},
107109
{
108110
cType: CollectorTypeEnvoyGatewayResource,
109111
collector: collect.EnvoyGatewayResource{

0 commit comments

Comments
 (0)