@@ -27,7 +27,7 @@ func JobList() []Job {
27
27
dc .Logger .Printf ("\t Could not retrieve pod list for namespace %s: %v\n " , namespace , err )
28
28
} else {
29
29
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
31
31
}
32
32
}
33
33
ch <- jobResult
@@ -45,7 +45,7 @@ func JobList() []Job {
45
45
}
46
46
for _ , pod := range pods .Items {
47
47
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 ))
49
49
bufferedLogs := dc .K8sCoreClientSet .CoreV1 ().Pods (namespace ).GetLogs (pod .Name , & corev1.PodLogOptions {Container : container .Name })
50
50
podLogs , err := bufferedLogs .Stream (context .TODO ())
51
51
if err != nil {
@@ -77,7 +77,7 @@ func JobList() []Job {
77
77
dc .Logger .Printf ("\t Could not retrieve events list for namespace %s: %v\n " , namespace , err )
78
78
} else {
79
79
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
81
81
}
82
82
}
83
83
ch <- jobResult
@@ -94,7 +94,7 @@ func JobList() []Job {
94
94
dc .Logger .Printf ("\t Could not retrieve configmap list for namespace %s: %v\n " , namespace , err )
95
95
} else {
96
96
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
98
98
}
99
99
}
100
100
@@ -112,7 +112,7 @@ func JobList() []Job {
112
112
dc .Logger .Printf ("\t Could not retrieve services list for namespace %s: %v\n " , namespace , err )
113
113
} else {
114
114
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
116
116
}
117
117
}
118
118
ch <- jobResult
@@ -129,7 +129,7 @@ func JobList() []Job {
129
129
dc .Logger .Printf ("\t Could not retrieve deployments list for namespace %s: %v\n " , namespace , err )
130
130
} else {
131
131
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
133
133
}
134
134
}
135
135
ch <- jobResult
@@ -146,7 +146,7 @@ func JobList() []Job {
146
146
dc .Logger .Printf ("\t Could not retrieve statefulsets list for namespace %s: %v\n " , namespace , err )
147
147
} else {
148
148
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
150
150
}
151
151
}
152
152
ch <- jobResult
@@ -163,7 +163,7 @@ func JobList() []Job {
163
163
dc .Logger .Printf ("\t Could not retrieve replicasets list for namespace %s: %v\n " , namespace , err )
164
164
} else {
165
165
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
167
167
}
168
168
}
169
169
ch <- jobResult
@@ -180,7 +180,7 @@ func JobList() []Job {
180
180
dc .Logger .Printf ("\t Could not retrieve leases list for namespace %s: %v\n " , namespace , err )
181
181
} else {
182
182
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
184
184
}
185
185
}
186
186
ch <- jobResult
@@ -307,7 +307,7 @@ func JobList() []Job {
307
307
if err != nil {
308
308
dc .Logger .Printf ("\t Command execution %s failed for pod %s in namespace %s: %v\n " , command , pod .Name , namespace , err )
309
309
} 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
311
311
}
312
312
}
313
313
}
0 commit comments