From 964e354d0630aac0a84c385cf2902d5ae7442cdf Mon Sep 17 00:00:00 2001 From: Harshavardhana Date: Thu, 24 Jan 2019 19:14:05 +0530 Subject: [PATCH] Fix liveness check for NAS gateway (#7142) Current master throws '503' unavailable for liveness check ``` ~ curl -v http://localhost:9000/minio/health/live > GET /minio/health/live HTTP/1.1 ... ... < HTTP/1.1 503 Service Unavailable ``` With this fix liveness check returns error appropriately ``` ~ curl -v http://localhost:9000/minio/health/live > GET /minio/health/live HTTP/1.1 ... ... < HTTP/1.1 200 OK ``` --- cmd/gateway/nas/gateway-nas.go | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/cmd/gateway/nas/gateway-nas.go b/cmd/gateway/nas/gateway-nas.go index 876a3fc5e..f62fee82b 100644 --- a/cmd/gateway/nas/gateway-nas.go +++ b/cmd/gateway/nas/gateway-nas.go @@ -17,6 +17,8 @@ package nas import ( + "context" + "github.com/minio/cli" minio "github.com/minio/minio/cmd" "github.com/minio/minio/pkg/auth" @@ -121,6 +123,12 @@ func (n *nasObjects) IsListenBucketSupported() bool { return false } +func (n *nasObjects) StorageInfo(ctx context.Context) minio.StorageInfo { + sinfo := n.ObjectLayer.StorageInfo(ctx) + sinfo.Backend.Type = minio.Unknown + return sinfo +} + // nasObjects implements gateway for Minio and S3 compatible object storage servers. type nasObjects struct { minio.ObjectLayer