Skip to content

Commit 3471c99

Browse files
committed
chore: output folder reorg
1 parent efd37da commit 3471c99

File tree

1 file changed

+10
-10
lines changed

1 file changed

+10
-10
lines changed

pkg/jobs/job_list.go

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ func JobList() []Job {
2727
dc.Logger.Printf("\tCould not retrieve pod list for namespace %s: %v\n", namespace, err)
2828
} else {
2929
jsonResult, _ := json.MarshalIndent(result, "", " ")
30-
jobResult.Files[path.Join(dc.BaseDir, namespace, "pods.json")] = jsonResult
30+
jobResult.Files[path.Join(dc.BaseDir, "resources", namespace, "pods.json")] = jsonResult
3131
}
3232
}
3333
ch <- jobResult
@@ -45,7 +45,7 @@ func JobList() []Job {
4545
}
4646
for _, pod := range pods.Items {
4747
for _, container := range pod.Spec.Containers {
48-
logFileName := path.Join(dc.BaseDir, namespace, "logs", fmt.Sprintf("%s__%s.txt", pod.Name, container.Name))
48+
logFileName := path.Join(dc.BaseDir, "logs", namespace, fmt.Sprintf("%s__%s.txt", pod.Name, container.Name))
4949
bufferedLogs := dc.K8sCoreClientSet.CoreV1().Pods(namespace).GetLogs(pod.Name, &corev1.PodLogOptions{Container: container.Name})
5050
podLogs, err := bufferedLogs.Stream(context.TODO())
5151
if err != nil {
@@ -77,7 +77,7 @@ func JobList() []Job {
7777
dc.Logger.Printf("\tCould not retrieve events list for namespace %s: %v\n", namespace, err)
7878
} else {
7979
jsonResult, _ := json.MarshalIndent(result, "", " ")
80-
jobResult.Files[path.Join(dc.BaseDir, namespace, "events.json")] = jsonResult
80+
jobResult.Files[path.Join(dc.BaseDir, "resources", namespace, "events.json")] = jsonResult
8181
}
8282
}
8383
ch <- jobResult
@@ -94,7 +94,7 @@ func JobList() []Job {
9494
dc.Logger.Printf("\tCould not retrieve configmap list for namespace %s: %v\n", namespace, err)
9595
} else {
9696
jsonResult, _ := json.MarshalIndent(result, "", " ")
97-
jobResult.Files[path.Join(dc.BaseDir, namespace, "configmaps.json")] = jsonResult
97+
jobResult.Files[path.Join(dc.BaseDir, "resources", namespace, "configmaps.json")] = jsonResult
9898
}
9999
}
100100

@@ -112,7 +112,7 @@ func JobList() []Job {
112112
dc.Logger.Printf("\tCould not retrieve services list for namespace %s: %v\n", namespace, err)
113113
} else {
114114
jsonResult, _ := json.MarshalIndent(result, "", " ")
115-
jobResult.Files[path.Join(dc.BaseDir, namespace, "services.json")] = jsonResult
115+
jobResult.Files[path.Join(dc.BaseDir, "resources", namespace, "services.json")] = jsonResult
116116
}
117117
}
118118
ch <- jobResult
@@ -129,7 +129,7 @@ func JobList() []Job {
129129
dc.Logger.Printf("\tCould not retrieve deployments list for namespace %s: %v\n", namespace, err)
130130
} else {
131131
jsonResult, _ := json.MarshalIndent(result, "", " ")
132-
jobResult.Files[path.Join(dc.BaseDir, namespace, "deployments.json")] = jsonResult
132+
jobResult.Files[path.Join(dc.BaseDir, "resources", namespace, "deployments.json")] = jsonResult
133133
}
134134
}
135135
ch <- jobResult
@@ -146,7 +146,7 @@ func JobList() []Job {
146146
dc.Logger.Printf("\tCould not retrieve statefulsets list for namespace %s: %v\n", namespace, err)
147147
} else {
148148
jsonResult, _ := json.MarshalIndent(result, "", " ")
149-
jobResult.Files[path.Join(dc.BaseDir, namespace, "statefulsets.json")] = jsonResult
149+
jobResult.Files[path.Join(dc.BaseDir, "resources", namespace, "statefulsets.json")] = jsonResult
150150
}
151151
}
152152
ch <- jobResult
@@ -163,7 +163,7 @@ func JobList() []Job {
163163
dc.Logger.Printf("\tCould not retrieve replicasets list for namespace %s: %v\n", namespace, err)
164164
} else {
165165
jsonResult, _ := json.MarshalIndent(result, "", " ")
166-
jobResult.Files[path.Join(dc.BaseDir, namespace, "replicasets.json")] = jsonResult
166+
jobResult.Files[path.Join(dc.BaseDir, "resources", namespace, "replicasets.json")] = jsonResult
167167
}
168168
}
169169
ch <- jobResult
@@ -180,7 +180,7 @@ func JobList() []Job {
180180
dc.Logger.Printf("\tCould not retrieve leases list for namespace %s: %v\n", namespace, err)
181181
} else {
182182
jsonResult, _ := json.MarshalIndent(result, "", " ")
183-
jobResult.Files[path.Join(dc.BaseDir, namespace, "leases.json")] = jsonResult
183+
jobResult.Files[path.Join(dc.BaseDir, "resources", namespace, "leases.json")] = jsonResult
184184
}
185185
}
186186
ch <- jobResult
@@ -307,7 +307,7 @@ func JobList() []Job {
307307
if err != nil {
308308
dc.Logger.Printf("\tCommand execution %s failed for pod %s in namespace %s: %v\n", command, pod.Name, namespace, err)
309309
} else {
310-
jobResult.Files[path.Join(dc.BaseDir, namespace, pod.Name+"-nginx-t.txt")] = res
310+
jobResult.Files[path.Join(dc.BaseDir, "exec", namespace, pod.Name+"__nginx-t.txt")] = res
311311
}
312312
}
313313
}

0 commit comments

Comments
 (0)