From 166e9987885dfeb953823f907cb0a4986a7d2b01 Mon Sep 17 00:00:00 2001 From: Harshavardhana Date: Tue, 11 Sep 2018 13:44:10 -0700 Subject: [PATCH] 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. --- cmd/healthcheck-handler.go | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/cmd/healthcheck-handler.go b/cmd/healthcheck-handler.go index 9825959a0..5364d496e 100644 --- a/cmd/healthcheck-handler.go +++ b/cmd/healthcheck-handler.go @@ -57,8 +57,8 @@ func LivenessCheckHandler(w http.ResponseWriter, r *http.Request) { } s := objLayer.StorageInfo(ctx) - // Gateways don't provide disk info - if s.Backend.Type == Unknown { + // Gateways don't provide disk info, also handle special case for NAS gateway. + if s.Backend.Type == Unknown || s.Backend.Type == BackendFS { // ListBuckets to confirm gateway backend is up if _, err := objLayer.ListBuckets(ctx); err != nil { 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 // take us down. if totalLocalDisks == erroredDisks {