This repository is currently being migrated. It's locked while the migration is in progress.
-
Notifications
You must be signed in to change notification settings - Fork 0
/
main.go
159 lines (155 loc) · 15.7 KB
/
main.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
package main
// Write a function that validates that a []string of files contains all the
// expected files, and no unexpected files.
// Expected files for a given node are the nodeFiles.
// Expected files for a cluster are the clusterFiles
func verifyBundle(bundleFiles []string, nodeIDs []string) error {
return nil
}
// nodeLevelFiles contains a slice of files that are expected to be found for
// each node_ID in the diagnostic bundle.
// For instance, given two nodes: node_A... and node_B...
// We would expect to find node_A/cached_licence AND node_B/cached_licence files.
var nodeFiles = []string{
"attached_volumes",
"cached_licence",
"capacity",
"crashes",
"dataplane_config",
"dataplane_crashes",
"dmesg_output",
"env_config",
"local_time",
"local_volumes",
"log_latest",
"lshw_output",
"nfs_logs",
"peer_health",
"rotated_logs",
"version",
"metrics",
"metrics/api_metrics.csv",
"metrics/csi_backend_metrics.csv",
"metrics/csi_controller_metrics.csv",
"metrics/csi_identity_metrics.csv",
"metrics/csi_node_metrics.csv",
"metrics/dataplane_dfs_metrics.csv",
"metrics/dataplane_director_metrics.csv",
"metrics/dataplane_fs_metrics.csv",
"metrics/dataplane_metrics.csv",
"metrics/dataplane_rdb_metrics.csv",
"metrics/dataplane_supervisor_metrics.csv",
"metrics/state_tracker_metrics.csv",
"metrics/store_metrics.csv",
}
// clusterLevelFiles contains a slice of files that are expected to be found in
// a diagnostic bundle. These files are only expected to be found once per
// bundle, regardless of the node count.
var clusterFiles = []string{
"cluster_config",
"namespace_partitions",
"node_configs",
"volume_configs",
}
// files contains a slice of walked file paths from a StorageOS diagnostic
// bundle. This var is for illustrative purposes only.
//var files = []string{
// "/tmp/diagBundle-90976411/HttpClientFile771489167/2021-09-03T15-56-35.195000555Z",
// "/tmp/diagBundle-90976411/HttpClientFile771489167/2021-09-03T15-56-35.195000555Z/cluster_config",
// "/tmp/diagBundle-90976411/HttpClientFile771489167/2021-09-03T15-56-35.195000555Z/namespace_partitions",
// "/tmp/diagBundle-90976411/HttpClientFile771489167/2021-09-03T15-56-35.195000555Z/node_240c0131-6cae-4951-a3a7-33933eef2fed",
// "/tmp/diagBundle-90976411/HttpClientFile771489167/2021-09-03T15-56-35.195000555Z/node_240c0131-6cae-4951-a3a7-33933eef2fed/attached_volumes",
// "/tmp/diagBundle-90976411/HttpClientFile771489167/2021-09-03T15-56-35.195000555Z/node_240c0131-6cae-4951-a3a7-33933eef2fed/cached_licence",
// "/tmp/diagBundle-90976411/HttpClientFile771489167/2021-09-03T15-56-35.195000555Z/node_240c0131-6cae-4951-a3a7-33933eef2fed/capacity",
// "/tmp/diagBundle-90976411/HttpClientFile771489167/2021-09-03T15-56-35.195000555Z/node_240c0131-6cae-4951-a3a7-33933eef2fed/crashes",
// "/tmp/diagBundle-90976411/HttpClientFile771489167/2021-09-03T15-56-35.195000555Z/node_240c0131-6cae-4951-a3a7-33933eef2fed/dataplane_config",
// "/tmp/diagBundle-90976411/HttpClientFile771489167/2021-09-03T15-56-35.195000555Z/node_240c0131-6cae-4951-a3a7-33933eef2fed/dataplane_crashes",
// "/tmp/diagBundle-90976411/HttpClientFile771489167/2021-09-03T15-56-35.195000555Z/node_240c0131-6cae-4951-a3a7-33933eef2fed/dmesg_output",
// "/tmp/diagBundle-90976411/HttpClientFile771489167/2021-09-03T15-56-35.195000555Z/node_240c0131-6cae-4951-a3a7-33933eef2fed/env_config",
// "/tmp/diagBundle-90976411/HttpClientFile771489167/2021-09-03T15-56-35.195000555Z/node_240c0131-6cae-4951-a3a7-33933eef2fed/local_time",
// "/tmp/diagBundle-90976411/HttpClientFile771489167/2021-09-03T15-56-35.195000555Z/node_240c0131-6cae-4951-a3a7-33933eef2fed/local_volumes",
// "/tmp/diagBundle-90976411/HttpClientFile771489167/2021-09-03T15-56-35.195000555Z/node_240c0131-6cae-4951-a3a7-33933eef2fed/log_latest",
// "/tmp/diagBundle-90976411/HttpClientFile771489167/2021-09-03T15-56-35.195000555Z/node_240c0131-6cae-4951-a3a7-33933eef2fed/lshw_output",
// "/tmp/diagBundle-90976411/HttpClientFile771489167/2021-09-03T15-56-35.195000555Z/node_240c0131-6cae-4951-a3a7-33933eef2fed/metrics",
// "/tmp/diagBundle-90976411/HttpClientFile771489167/2021-09-03T15-56-35.195000555Z/node_240c0131-6cae-4951-a3a7-33933eef2fed/metrics/api_metrics.csv",
// "/tmp/diagBundle-90976411/HttpClientFile771489167/2021-09-03T15-56-35.195000555Z/node_240c0131-6cae-4951-a3a7-33933eef2fed/metrics/csi_backend_metrics.csv",
// "/tmp/diagBundle-90976411/HttpClientFile771489167/2021-09-03T15-56-35.195000555Z/node_240c0131-6cae-4951-a3a7-33933eef2fed/metrics/csi_controller_metrics.csv",
// "/tmp/diagBundle-90976411/HttpClientFile771489167/2021-09-03T15-56-35.195000555Z/node_240c0131-6cae-4951-a3a7-33933eef2fed/metrics/csi_identity_metrics.csv",
// "/tmp/diagBundle-90976411/HttpClientFile771489167/2021-09-03T15-56-35.195000555Z/node_240c0131-6cae-4951-a3a7-33933eef2fed/metrics/csi_node_metrics.csv",
// "/tmp/diagBundle-90976411/HttpClientFile771489167/2021-09-03T15-56-35.195000555Z/node_240c0131-6cae-4951-a3a7-33933eef2fed/metrics/dataplane_dfs_metrics.csv",
// "/tmp/diagBundle-90976411/HttpClientFile771489167/2021-09-03T15-56-35.195000555Z/node_240c0131-6cae-4951-a3a7-33933eef2fed/metrics/dataplane_director_metrics.csv",
// "/tmp/diagBundle-90976411/HttpClientFile771489167/2021-09-03T15-56-35.195000555Z/node_240c0131-6cae-4951-a3a7-33933eef2fed/metrics/dataplane_fs_metrics.csv",
// "/tmp/diagBundle-90976411/HttpClientFile771489167/2021-09-03T15-56-35.195000555Z/node_240c0131-6cae-4951-a3a7-33933eef2fed/metrics/dataplane_metrics.csv",
// "/tmp/diagBundle-90976411/HttpClientFile771489167/2021-09-03T15-56-35.195000555Z/node_240c0131-6cae-4951-a3a7-33933eef2fed/metrics/dataplane_rdb_metrics.csv",
// "/tmp/diagBundle-90976411/HttpClientFile771489167/2021-09-03T15-56-35.195000555Z/node_240c0131-6cae-4951-a3a7-33933eef2fed/metrics/dataplane_supervisor_metrics.csv",
// "/tmp/diagBundle-90976411/HttpClientFile771489167/2021-09-03T15-56-35.195000555Z/node_240c0131-6cae-4951-a3a7-33933eef2fed/metrics/state_tracker_metrics.csv",
// "/tmp/diagBundle-90976411/HttpClientFile771489167/2021-09-03T15-56-35.195000555Z/node_240c0131-6cae-4951-a3a7-33933eef2fed/metrics/store_metrics.csv",
// "/tmp/diagBundle-90976411/HttpClientFile771489167/2021-09-03T15-56-35.195000555Z/node_240c0131-6cae-4951-a3a7-33933eef2fed/nfs_logs",
// "/tmp/diagBundle-90976411/HttpClientFile771489167/2021-09-03T15-56-35.195000555Z/node_240c0131-6cae-4951-a3a7-33933eef2fed/peer_health",
// "/tmp/diagBundle-90976411/HttpClientFile771489167/2021-09-03T15-56-35.195000555Z/node_240c0131-6cae-4951-a3a7-33933eef2fed/rotated_logs",
// "/tmp/diagBundle-90976411/HttpClientFile771489167/2021-09-03T15-56-35.195000555Z/node_240c0131-6cae-4951-a3a7-33933eef2fed/version",
// "/tmp/diagBundle-90976411/HttpClientFile771489167/2021-09-03T15-56-35.195000555Z/node_9866dd68-1029-497e-a15e-db9e6d621423",
// "/tmp/diagBundle-90976411/HttpClientFile771489167/2021-09-03T15-56-35.195000555Z/node_9866dd68-1029-497e-a15e-db9e6d621423/attached_volumes",
// "/tmp/diagBundle-90976411/HttpClientFile771489167/2021-09-03T15-56-35.195000555Z/node_9866dd68-1029-497e-a15e-db9e6d621423/cached_licence",
// "/tmp/diagBundle-90976411/HttpClientFile771489167/2021-09-03T15-56-35.195000555Z/node_9866dd68-1029-497e-a15e-db9e6d621423/capacity",
// "/tmp/diagBundle-90976411/HttpClientFile771489167/2021-09-03T15-56-35.195000555Z/node_9866dd68-1029-497e-a15e-db9e6d621423/crashes",
// "/tmp/diagBundle-90976411/HttpClientFile771489167/2021-09-03T15-56-35.195000555Z/node_9866dd68-1029-497e-a15e-db9e6d621423/dataplane_config",
// "/tmp/diagBundle-90976411/HttpClientFile771489167/2021-09-03T15-56-35.195000555Z/node_9866dd68-1029-497e-a15e-db9e6d621423/dataplane_crashes",
// "/tmp/diagBundle-90976411/HttpClientFile771489167/2021-09-03T15-56-35.195000555Z/node_9866dd68-1029-497e-a15e-db9e6d621423/dmesg_output",
// "/tmp/diagBundle-90976411/HttpClientFile771489167/2021-09-03T15-56-35.195000555Z/node_9866dd68-1029-497e-a15e-db9e6d621423/env_config",
// "/tmp/diagBundle-90976411/HttpClientFile771489167/2021-09-03T15-56-35.195000555Z/node_9866dd68-1029-497e-a15e-db9e6d621423/local_time",
// "/tmp/diagBundle-90976411/HttpClientFile771489167/2021-09-03T15-56-35.195000555Z/node_9866dd68-1029-497e-a15e-db9e6d621423/local_volumes",
// "/tmp/diagBundle-90976411/HttpClientFile771489167/2021-09-03T15-56-35.195000555Z/node_9866dd68-1029-497e-a15e-db9e6d621423/log_latest",
// "/tmp/diagBundle-90976411/HttpClientFile771489167/2021-09-03T15-56-35.195000555Z/node_9866dd68-1029-497e-a15e-db9e6d621423/lshw_output",
// "/tmp/diagBundle-90976411/HttpClientFile771489167/2021-09-03T15-56-35.195000555Z/node_9866dd68-1029-497e-a15e-db9e6d621423/metrics",
// "/tmp/diagBundle-90976411/HttpClientFile771489167/2021-09-03T15-56-35.195000555Z/node_9866dd68-1029-497e-a15e-db9e6d621423/metrics/api_metrics.csv",
// "/tmp/diagBundle-90976411/HttpClientFile771489167/2021-09-03T15-56-35.195000555Z/node_9866dd68-1029-497e-a15e-db9e6d621423/metrics/csi_backend_metrics.csv",
// "/tmp/diagBundle-90976411/HttpClientFile771489167/2021-09-03T15-56-35.195000555Z/node_9866dd68-1029-497e-a15e-db9e6d621423/metrics/csi_controller_metrics.csv",
// "/tmp/diagBundle-90976411/HttpClientFile771489167/2021-09-03T15-56-35.195000555Z/node_9866dd68-1029-497e-a15e-db9e6d621423/metrics/csi_identity_metrics.csv",
// "/tmp/diagBundle-90976411/HttpClientFile771489167/2021-09-03T15-56-35.195000555Z/node_9866dd68-1029-497e-a15e-db9e6d621423/metrics/csi_node_metrics.csv",
// "/tmp/diagBundle-90976411/HttpClientFile771489167/2021-09-03T15-56-35.195000555Z/node_9866dd68-1029-497e-a15e-db9e6d621423/metrics/dataplane_dfs_metrics.csv",
// "/tmp/diagBundle-90976411/HttpClientFile771489167/2021-09-03T15-56-35.195000555Z/node_9866dd68-1029-497e-a15e-db9e6d621423/metrics/dataplane_director_metrics.csv",
// "/tmp/diagBundle-90976411/HttpClientFile771489167/2021-09-03T15-56-35.195000555Z/node_9866dd68-1029-497e-a15e-db9e6d621423/metrics/dataplane_fs_metrics.csv",
// "/tmp/diagBundle-90976411/HttpClientFile771489167/2021-09-03T15-56-35.195000555Z/node_9866dd68-1029-497e-a15e-db9e6d621423/metrics/dataplane_metrics.csv",
// "/tmp/diagBundle-90976411/HttpClientFile771489167/2021-09-03T15-56-35.195000555Z/node_9866dd68-1029-497e-a15e-db9e6d621423/metrics/dataplane_rdb_metrics.csv",
// "/tmp/diagBundle-90976411/HttpClientFile771489167/2021-09-03T15-56-35.195000555Z/node_9866dd68-1029-497e-a15e-db9e6d621423/metrics/dataplane_supervisor_metrics.csv",
// "/tmp/diagBundle-90976411/HttpClientFile771489167/2021-09-03T15-56-35.195000555Z/node_9866dd68-1029-497e-a15e-db9e6d621423/metrics/state_tracker_metrics.csv",
// "/tmp/diagBundle-90976411/HttpClientFile771489167/2021-09-03T15-56-35.195000555Z/node_9866dd68-1029-497e-a15e-db9e6d621423/metrics/store_metrics.csv",
// "/tmp/diagBundle-90976411/HttpClientFile771489167/2021-09-03T15-56-35.195000555Z/node_9866dd68-1029-497e-a15e-db9e6d621423/nfs_logs",
// "/tmp/diagBundle-90976411/HttpClientFile771489167/2021-09-03T15-56-35.195000555Z/node_9866dd68-1029-497e-a15e-db9e6d621423/peer_health",
// "/tmp/diagBundle-90976411/HttpClientFile771489167/2021-09-03T15-56-35.195000555Z/node_9866dd68-1029-497e-a15e-db9e6d621423/rotated_logs",
// "/tmp/diagBundle-90976411/HttpClientFile771489167/2021-09-03T15-56-35.195000555Z/node_9866dd68-1029-497e-a15e-db9e6d621423/version",
// "/tmp/diagBundle-90976411/HttpClientFile771489167/2021-09-03T15-56-35.195000555Z/node_configs",
// "/tmp/diagBundle-90976411/HttpClientFile771489167/2021-09-03T15-56-35.195000555Z/node_d90292f3-4af6-44bd-a3d3-cf9277b57a2c",
// "/tmp/diagBundle-90976411/HttpClientFile771489167/2021-09-03T15-56-35.195000555Z/node_d90292f3-4af6-44bd-a3d3-cf9277b57a2c/attached_volumes",
// "/tmp/diagBundle-90976411/HttpClientFile771489167/2021-09-03T15-56-35.195000555Z/node_d90292f3-4af6-44bd-a3d3-cf9277b57a2c/cached_licence",
// "/tmp/diagBundle-90976411/HttpClientFile771489167/2021-09-03T15-56-35.195000555Z/node_d90292f3-4af6-44bd-a3d3-cf9277b57a2c/capacity",
// "/tmp/diagBundle-90976411/HttpClientFile771489167/2021-09-03T15-56-35.195000555Z/node_d90292f3-4af6-44bd-a3d3-cf9277b57a2c/crashes",
// "/tmp/diagBundle-90976411/HttpClientFile771489167/2021-09-03T15-56-35.195000555Z/node_d90292f3-4af6-44bd-a3d3-cf9277b57a2c/dataplane_config",
// "/tmp/diagBundle-90976411/HttpClientFile771489167/2021-09-03T15-56-35.195000555Z/node_d90292f3-4af6-44bd-a3d3-cf9277b57a2c/dataplane_crashes",
// "/tmp/diagBundle-90976411/HttpClientFile771489167/2021-09-03T15-56-35.195000555Z/node_d90292f3-4af6-44bd-a3d3-cf9277b57a2c/dmesg_output",
// "/tmp/diagBundle-90976411/HttpClientFile771489167/2021-09-03T15-56-35.195000555Z/node_d90292f3-4af6-44bd-a3d3-cf9277b57a2c/env_config",
// "/tmp/diagBundle-90976411/HttpClientFile771489167/2021-09-03T15-56-35.195000555Z/node_d90292f3-4af6-44bd-a3d3-cf9277b57a2c/local_time",
// "/tmp/diagBundle-90976411/HttpClientFile771489167/2021-09-03T15-56-35.195000555Z/node_d90292f3-4af6-44bd-a3d3-cf9277b57a2c/local_volumes",
// "/tmp/diagBundle-90976411/HttpClientFile771489167/2021-09-03T15-56-35.195000555Z/node_d90292f3-4af6-44bd-a3d3-cf9277b57a2c/log_latest",
// "/tmp/diagBundle-90976411/HttpClientFile771489167/2021-09-03T15-56-35.195000555Z/node_d90292f3-4af6-44bd-a3d3-cf9277b57a2c/lshw_output",
// "/tmp/diagBundle-90976411/HttpClientFile771489167/2021-09-03T15-56-35.195000555Z/node_d90292f3-4af6-44bd-a3d3-cf9277b57a2c/metrics",
// "/tmp/diagBundle-90976411/HttpClientFile771489167/2021-09-03T15-56-35.195000555Z/node_d90292f3-4af6-44bd-a3d3-cf9277b57a2c/metrics/api_metrics.csv",
// "/tmp/diagBundle-90976411/HttpClientFile771489167/2021-09-03T15-56-35.195000555Z/node_d90292f3-4af6-44bd-a3d3-cf9277b57a2c/metrics/csi_backend_metrics.csv",
// "/tmp/diagBundle-90976411/HttpClientFile771489167/2021-09-03T15-56-35.195000555Z/node_d90292f3-4af6-44bd-a3d3-cf9277b57a2c/metrics/csi_controller_metrics.csv",
// "/tmp/diagBundle-90976411/HttpClientFile771489167/2021-09-03T15-56-35.195000555Z/node_d90292f3-4af6-44bd-a3d3-cf9277b57a2c/metrics/csi_identity_metrics.csv",
// "/tmp/diagBundle-90976411/HttpClientFile771489167/2021-09-03T15-56-35.195000555Z/node_d90292f3-4af6-44bd-a3d3-cf9277b57a2c/metrics/csi_node_metrics.csv",
// "/tmp/diagBundle-90976411/HttpClientFile771489167/2021-09-03T15-56-35.195000555Z/node_d90292f3-4af6-44bd-a3d3-cf9277b57a2c/metrics/dataplane_dfs_metrics.csv",
// "/tmp/diagBundle-90976411/HttpClientFile771489167/2021-09-03T15-56-35.195000555Z/node_d90292f3-4af6-44bd-a3d3-cf9277b57a2c/metrics/dataplane_director_metrics.csv",
// "/tmp/diagBundle-90976411/HttpClientFile771489167/2021-09-03T15-56-35.195000555Z/node_d90292f3-4af6-44bd-a3d3-cf9277b57a2c/metrics/dataplane_fs_metrics.csv",
// "/tmp/diagBundle-90976411/HttpClientFile771489167/2021-09-03T15-56-35.195000555Z/node_d90292f3-4af6-44bd-a3d3-cf9277b57a2c/metrics/dataplane_metrics.csv",
// "/tmp/diagBundle-90976411/HttpClientFile771489167/2021-09-03T15-56-35.195000555Z/node_d90292f3-4af6-44bd-a3d3-cf9277b57a2c/metrics/dataplane_rdb_metrics.csv",
// "/tmp/diagBundle-90976411/HttpClientFile771489167/2021-09-03T15-56-35.195000555Z/node_d90292f3-4af6-44bd-a3d3-cf9277b57a2c/metrics/dataplane_supervisor_metrics.csv",
// "/tmp/diagBundle-90976411/HttpClientFile771489167/2021-09-03T15-56-35.195000555Z/node_d90292f3-4af6-44bd-a3d3-cf9277b57a2c/metrics/state_tracker_metrics.csv",
// "/tmp/diagBundle-90976411/HttpClientFile771489167/2021-09-03T15-56-35.195000555Z/node_d90292f3-4af6-44bd-a3d3-cf9277b57a2c/metrics/store_metrics.csv",
// "/tmp/diagBundle-90976411/HttpClientFile771489167/2021-09-03T15-56-35.195000555Z/node_d90292f3-4af6-44bd-a3d3-cf9277b57a2c/nfs_logs",
// "/tmp/diagBundle-90976411/HttpClientFile771489167/2021-09-03T15-56-35.195000555Z/node_d90292f3-4af6-44bd-a3d3-cf9277b57a2c/peer_health",
// "/tmp/diagBundle-90976411/HttpClientFile771489167/2021-09-03T15-56-35.195000555Z/node_d90292f3-4af6-44bd-a3d3-cf9277b57a2c/rotated_logs",
// "/tmp/diagBundle-90976411/HttpClientFile771489167/2021-09-03T15-56-35.195000555Z/node_d90292f3-4af6-44bd-a3d3-cf9277b57a2c/version",
// "/tmp/diagBundle-90976411/HttpClientFile771489167/2021-09-03T15-56-35.195000555Z/volume_configs",
//}