@@ -130,25 +130,41 @@ func PostRun(finalRecord define.Records, file string) {
130
130
}
131
131
}
132
132
writeString ("// Extracted information under \n " )
133
- log .Info ("Extract Namespaces: " )
134
- writeString ("// Extract Namespaces:" )
135
- list := post .RecordsDumpNameSpace (finalRecord , command .Opts .Zone )
136
- for _ , ns := range list {
137
- log .Infof ("Namespace: %s" , ns )
133
+
134
+ { // Namespaces
135
+ log .Info ("Extract Namespaces: " )
136
+ writeString ("// Extract Namespaces:\n " )
137
+ list := post .RecordsDumpNameSpace (finalRecord , command .Opts .Zone )
138
+ for _ , ns := range list {
139
+ log .Infof ("Namespace: %s" , ns )
140
+ }
141
+ writeString ("// Namespace: [" + strings .Join (list , "," ) + "]\n " )
138
142
}
139
- writeString ("// Namespace: [" + strings .Join (list , "," ) + "]\n " )
140
- log .Info ("Extract Service: " )
141
- writeString ("// Extract Service: " )
142
- list = post .RecordsDumpFullService (finalRecord , command .Opts .Zone )
143
- for _ , svc := range list {
144
- log .Infof ("Service: %s" , svc )
145
- writeString ("// \t \t " + svc + "\n " )
143
+
144
+ { // service
145
+ log .Info ("Extract Service: " )
146
+ writeString ("// Extract Service: \n " )
147
+ list := post .RecordsDumpFullService (finalRecord , command .Opts .Zone )
148
+ for _ , svc := range list {
149
+ if strings .Contains (svc , "metrics" ) {
150
+ if strings .Contains (svc , "kube-state-metrics" ) {
151
+ log .Warnf ("Checkout service %v, which maybe contains cluster metrics information" , svc )
152
+ } else {
153
+ log .Warnf ("Checkout service %v, which maybe contains apps metrics information" , svc )
154
+ }
155
+ }
156
+ log .Infof ("Service: %s" , svc )
157
+ writeString ("// \t \t " + svc + "\n " )
158
+ }
146
159
}
147
- log .Info ("Possible Pod and service ip maps" )
148
- writeString ("// Service maps: " )
149
- maps := post .PodServiceMap (finalRecord , command .Opts .Zone )
150
- for svc , ips := range maps {
151
- log .Infof ("Service: %s\n \t ips: [%s]" , svc , strings .Join (ips , "," ))
152
- writeString ("// Service: " + svc + "\n //\t ips: " + strings .Join (ips , "\n //\t \t " ) + "\n " )
160
+
161
+ { // service maps with pods and service ips
162
+ log .Info ("Possible Pod and service ip maps" )
163
+ writeString ("// Service maps: \n " )
164
+ maps := post .PodServiceMap (finalRecord , command .Opts .Zone )
165
+ for svc , ips := range maps {
166
+ log .Infof ("Service: %s\n \t ips: [%s]" , svc , strings .Join (ips , "," ))
167
+ writeString ("// Service: " + svc + "\n //\t ips:\t " + strings .Join (ips , "\n //\t \t " ) + "\n " )
168
+ }
153
169
}
154
170
}
0 commit comments