[Bugfix] Fix Net tests being omitted (#9234)

master
Sidhartha Mani 5 years ago committed by GitHub
parent ba52a925f9
commit 7b732b566f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 5
      cmd/admin-handlers.go
  2. 10
      cmd/notification.go

@ -1388,10 +1388,9 @@ func (a adminAPIHandlers) OBDInfoHandler(w http.ResponseWriter, r *http.Request)
w.Header().Set(xhttp.ContentType, string(mimeJSON)) w.Header().Set(xhttp.ContentType, string(mimeJSON))
w.WriteHeader(http.StatusOK) w.WriteHeader(http.StatusOK)
enc := json.NewEncoder(w)
partialWrite := func() { partialWrite := func() {
jsonBytes, _ := json.Marshal(obdInfo) logger.LogIf(ctx, enc.Encode(obdInfo))
_, err := w.Write(jsonBytes)
logger.LogIf(ctx, err)
} }
finish := func() { finish := func() {

@ -911,17 +911,13 @@ func (sys *NotificationSys) NetOBDInfo(ctx context.Context) madmin.ServerNetOBDI
'x's should be tested, and 'o's should be skipped 'x's should be tested, and 'o's should be skipped
*/ */
stripPath := func(hostPath string) string {
return strings.Split(hostPath, slashSeparator)[0]
}
hostSet := set.NewStringSet() hostSet := set.NewStringSet()
for _, ez := range globalEndpoints { for _, ez := range globalEndpoints {
for _, e := range ez.Endpoints { for _, e := range ez.Endpoints {
host := stripPath(e.Host) if !hostSet.Contains(e.Host) {
if hostSet.Contains(host) { sortedGlobalEndpoints = append(sortedGlobalEndpoints, e.Host)
sortedGlobalEndpoints = append(sortedGlobalEndpoints, host) hostSet.Add(e.Host)
hostSet.Add(host)
} }
} }
} }

Loading…
Cancel
Save