Skip to content

Commit 1f96b29

Browse files
committed
Feat: Collect secrets and events info
1 parent 4fcf927 commit 1f96b29

File tree

1 file changed

+22
-0
lines changed

1 file changed

+22
-0
lines changed

pkg/jobs/job_list.go

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -171,6 +171,28 @@ func JobList() []Job {
171171
return jobResults
172172
},
173173
},
174+
{
175+
Name: "events-info",
176+
Global: true,
177+
Execute: func(dc *data_collector.DataCollector, ctx context.Context) map[string][]byte {
178+
jobResults := make(map[string][]byte)
179+
result, _ := dc.K8sCoreClientSet.CoreV1().Events("").List(ctx, metav1.ListOptions{})
180+
jsonResult, _ := json.MarshalIndent(result, "", " ")
181+
jobResults[path.Join(dc.BaseDir, "k8s", "events.json")] = jsonResult
182+
return jobResults
183+
},
184+
},
185+
{
186+
Name: "secrets-info",
187+
Global: true,
188+
Execute: func(dc *data_collector.DataCollector, ctx context.Context) map[string][]byte {
189+
jobResults := make(map[string][]byte)
190+
result, _ := dc.K8sCoreClientSet.CoreV1().Secrets("").List(ctx, metav1.ListOptions{})
191+
jsonResult, _ := json.MarshalIndent(result, "", " ")
192+
jobResults[path.Join(dc.BaseDir, "k8s", "secrets.json")] = jsonResult
193+
return jobResults
194+
},
195+
},
174196
{
175197
Name: "metrics-information",
176198
Global: true,

0 commit comments

Comments
 (0)