Fix healthcheck for NAS gateway (#6452)

It was expected that in gateway mode, we do not know
the backend types whereas in NAS gateway since its
an extension of FS mode (standalone) this leads to
an issue in LivenessCheckHandler() which would perpetually
return 503, this would affect all kubernetes, openshift
deployments of NAS gateway.
master
Harshavardhana 6 years ago committed by GitHub
parent 267a0a3dfa
commit 166e998788
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 5
      cmd/healthcheck-handler.go

@ -57,8 +57,8 @@ func LivenessCheckHandler(w http.ResponseWriter, r *http.Request) {
} }
s := objLayer.StorageInfo(ctx) s := objLayer.StorageInfo(ctx)
// Gateways don't provide disk info // Gateways don't provide disk info, also handle special case for NAS gateway.
if s.Backend.Type == Unknown { if s.Backend.Type == Unknown || s.Backend.Type == BackendFS {
// ListBuckets to confirm gateway backend is up // ListBuckets to confirm gateway backend is up
if _, err := objLayer.ListBuckets(ctx); err != nil { if _, err := objLayer.ListBuckets(ctx); err != nil {
writeResponse(w, http.StatusServiceUnavailable, nil, mimeNone) writeResponse(w, http.StatusServiceUnavailable, nil, mimeNone)
@ -84,6 +84,7 @@ func LivenessCheckHandler(w http.ResponseWriter, r *http.Request) {
} }
} }
} }
// If all exported local disks have errored, we simply let kubernetes // If all exported local disks have errored, we simply let kubernetes
// take us down. // take us down.
if totalLocalDisks == erroredDisks { if totalLocalDisks == erroredDisks {

Loading…
Cancel
Save